Hypothesis: To Test Whether The

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

1.

Objectives of the study

 To test whether the of a shipment of lumber was less than usual.


 To test the effect of a new drug administered to patients with hypertension.

2. Hypothesis

Null hypothesis- H0 mu=39000

alternative hypothesis: true mean is not equal to 39000

3. Data and application of t test

Q1. If we wanted to test whether the volume of a shipment of lumber was less than usual
(μ0=39000μ0=39000 cubic feet).

> Set.seed(0)

> treeVolume -c (rnorm(75, mean=3650, sd=2000))

> t.test (tree volume, mu=39000) #H0:mu=39000

data: treeVolume
t = -12.2883, df = 74, p-value < 2.2e-16
alternative hypothesis: true mean is not equal to 39000
95 percent confidence interval:
36033.60 36861.38
sample estimates:
mean of x
36447.49

We see that the current shipment of lumber has a significantly lower volume than we usually see:

t = -12.2883, p-value < 2.2e-16

Q2.  Let’s say that we work at a large health clinic and we’re testing a new drug, Procardia, that’s
meant to reduce hypertension. We find 1000 individuals with a high systolic blood pressure
(¯x=145x¯=145mmHg, SD=9SD=9mmHg), we give them Procardia for a month, and then
measure their blood pressure again. We find that the mean systolic blood pressure has decreased
to 138mmHg with a standard deviation 8mmHg.
> set.seed(2820)

> preTreat < - c(rnorm (1000, mean =145 ,sd =9)

> postTreat < - c(rnorm (1000, mean =138 ,sd =8))

> t.test (preTreat, postTreat, paired = TRUE)

Paired t-test

data: preTreat and postTreat


t = 19.7514, df = 999, p-value < 2.2e-16
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
6.703959 8.183011
sample estimates:
mean of the differences
7.443485

We see that there is a statistically significant difference in mean on

t = 19.7514, p-value < 2.2e-16

4. Statistical Techniques

T-test and paired t-test was administered on the datasets.

5. R code

For 1st dataset

> Set.seed(0)

> treeVolume -c (rnorm(75, mean=3650, sd=2000))

> t.test (tree volume, mu=39000) #H0:mu=39000


For 2nd dataset

> set.seed(2820)

> preTreat < - c(rnorm (1000, mean =145 ,sd =9)

> postTreat < - c(rnorm (1000, mean =138 ,sd =8))

> t.test (preTreat, postTreat, paired = TRUE)

6. Results

1. t = -12.2883, p-value < 2.2e-16


2. t = 19.7514, p-value < 2.2e-16

7. Interpretations

1. We see that the current shipment of lumber has a significantly lower volume than we
usually see.
2. We see that there is a statistically significant difference in mean.

You might also like