Download Hypothesis Testing

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Psychometrics wikipedia , lookup

Foundations of statistics wikipedia , lookup

Omnibus test wikipedia , lookup

Statistical hypothesis testing wikipedia , lookup

Misuse of statistics wikipedia , lookup

Resampling (statistics) wikipedia , lookup

Student's t-test wikipedia , lookup

Transcript
Statistics 215 Lab materials
Hypothesis Testing
Hypothesis test for paired difference of two population means, µ d
We are often interested in making inference from two populations. In particular, we are interested in
comparing the means of these two populations. We first compare the means of two populations whose
units are paired. The observations in the sample from one population are matched, according to some
criteria, to the observations in the sample from the second population.
Two-sided Alternative Hypothesis
If
1) σ is unknown AND n>2 and the data is normal
OR
2) n ≥ 30 , where n is the number of sample differences
then we can use the following to test a particular value for the paired difference of population means.
1.H0: µd = 0
2.H1: µd ≠ 0
3.Significance level is α.
4. The test statistics is t=
d
sd
n
5. The table value will be t(n-1,1-
α
/2)
€
6. Decision Rule: Reject H0 if T.S. > tabled value OR if T.S. < - tabled value
Otherwise do not reject H0
Note that the calculation of
and sd are as they were for the CI for µd. They are the mean and the
standard deviation of the differences between the two sets of measurements.
Example:
Suppose that you want to test whether or not the difference of the means of two paired populations is zero.
After sampling 58 observations from these populations, the sample mean of the differences is 4.052 and the
sample standard deviation of the differences is 8.382. Use α = 0.05.
Since n>30, we can use the steps given above to carried out this hypothesis test.
1.H0: µd = 0
2.H1: µd ≠ 0
3.Significance level is α = 0.05.
4. The test statistics is t=
d
sd
4.052
= 3.681
8.382
58
n
5. The table value will be t(n-1,1-
€
=
α
/2)= t(57,0.975)≈z0.975=1.960.
€
1 of 4
Statistics 215 Lab materials
6. Decision Rule: Reject H0 if T.S. > tabled value OR if T.S. < - tabled value
Otherwise Do not reject H0
Since T.S. (3.681) > tabled value (1.960), then we reject the null hypothesis
7. Conclusion: At the 5% significance level we conclude that the difference of the means of these two
paired populations is significantly different from zero.
Example:
A study is done to determine the effect of gypsy moth infestation on growth rates for oak trees. 48 trees are
sampled from the upper peninsula of Michigan. These 48 trees were tagged and their growth rates
measured 8 years ago. This past summer the trees were re-measured to determine their present growth rate.
In the interim, the gypsy moth has begun to invade the upper peninsula of Michigan. The mean difference
in growth rates is found to be –1.29 hy/w with a standard deviation of 7.35 hy/w. Test the null hypothesis
that the mean growth rates remain unchanged with α = 0.10.
Since n>30, we can use the hypothesis test described above to test the null hypothesis.
1.H0: µd = 0
2.H1: µd ≠ 0
3.Significance level is α=0.05.
4. The test statistics is t=
d
sd
−1.29
= - 1.22
7.35
48
n
5. The table value will be t(n-1,1-
€
=
α
/2)= t(47,0.95)= )≈z0.95=1.645.
€
6. Decision Rule: Reject H0 if T.S. > tabled value OR if T.S. < - tabled value
Otherwise Do not reject H0
Since T.S. (1.22) < tabled value(1.645), then we do not reject the null hypothesis
7. Conclusion: At the 5 % significance level we conclude that the difference between the paired means
growth rates is approximately zero (µd=0), i.e., the mean growth rate is unchanged.
One-sided Alternative Hypothesis
If
1) σ is unknown AND n>2 and the data is normal
OR
2) n ≥ 30 , where n is the number of sample differences
then we can use the following to test a particular value for the paired difference of population means.
1.H0: µd= 0
2.H1: µd< 0 [µd > 0]
3.Significance level is α.
4. The test statistics is t=
2 of 4
Statistics 215 Lab materials
5. The table value will be t(n-1, 1-
α
)
6. Decision Rule: Reject H0 if T.S. < - tabled value
Otherwise Do not reject H0
[Decision Rule: Reject H0 if T.S. > tabled value
Otherwise Do not reject H0 ]
Example:
A study is done on stress levels of college students. As part of this test 75 randomly selected students agree
to have their apistologic blood pressure taken at the beginning of the semester and just prior to finals week.
The differences were computed as end-of-semester b.p. minus beginning-of-semester b.p. For the 75
students the sample mean difference was 6.51 . The sample standard deviation of the differences was
15.29. Test the hypothesis that the students mean blood pressure increased using α = 0.10.
Since n>30, we can use the following to test the null hypothesis.
1.H0: µd= 0
2.H1: µd > 0
3.Significance level is α = 0.10
4. The test statistics is t=
=
=3.687
5. The table value will be t(n-1, 1- ) = t(74, 0.90) )≈z0.95=1.280.
α
6. Decision Rule: Reject H0 if T.S. > tabled value
Otherwise Do not reject H0
Since T.S. (3.687) > tabled value (1.280) then we reject the null hypothesis
7. Conclusion: At the 10% significance level we conclude that there was a significant increase in the
population mean blood pressure. For this example, the population is all college students.
p-values
There is another way to determine whether or not a hypothesis should be rejected or not rejected. That way
is through the idea of p-values. For hypothesis testing, our logic is that if the observed test statistic is at the
edge of the distribution, then we reject the null hypothesis. To do this we compare the test statistic to some
tabled value that corresponds to a percentile of the distribution. The other way is to compare the area
beyond the test statistic to the area defined by α. If the area beyond the test statistic is smaller than α, then
you reject the null hypothesis. If the area beyond the test statistic is larger than α, then you do not reject the
null hypothesis. Consider the following graph.
Sampling distribution of the test
statistic.
This area = p-value.
3 of 4
Observed value of the test
statistic
Statistics 215 Lab materials
The observed test statistic will be somewhere along the x-axis of this distribution. The area beyond that
value will be called the p-value. If the p-value is small, then we reject since a small p-value implies a
smaller area beyond the observed value of the test statistic than is beyond the “tabled value”. If the p-value
is larger than α, then we do not reject since a large p-value implies an area beyond the observed value of
the test statistic that is larger than the area beyond the “tabled value.” The upside to p-values is that you
need only compare the p-value to α.
The rules for using p-values.
1. For any hypothesis test, if the p-value is more than the significance level, α, then you do not reject the
null hypothesis.
2. For any hypothesis test, if the p-value is less than α, then you reject the null hypothesis.
Another facet of using p-values which makes them appealing is they can be used regardless of the value of
α. That is, if you simply report the p-value then regardless of the value of α that the reader wants to use,
they can make their own decision. For this reason presenting the p-value for a hypothesis test is quite
common.
Note: When you are using computer software to calculate test statistics and p-values, there are different
methods for calculating p-values for one-sided and two-sided alternative hypotheses. It is important to
know how a p-value is reported by the software packages. The problem arises because there are two ways
to report p-values for a two-sided alternative hypothesis. These leads to two different decision rules.
Example:
If we are testing a null hypothesis using α = 0.10 and we find that the p-value is 0.04, we reject the null
hypothesis since the p-value is smaller than α.
Example:
A medical journal reports the results of a two-sided hypothesis test for comparing the means effects of two
drugs for tuberculosis. Their null hypothesis is the two drugs have the same effect and the alternative is
two-sided. They report a p-value for that test of 0.067. If you want to test the null hypothesis using α =
0.05, you would not reject the null hypothesis since the p-value of 0.067 > α = 0.05.
4 of 4