Download One-Sample Hypothesis Tests

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
no text concepts found
Transcript
Week 2 Lecture: One-Sample Hypothesis Tests (Chapter 7)
If the population variance, σ2, is unknown for a normal distribution, the Student’s t-distribution
is used for statistical inference. The population variance is estimated from the variance of a
random sample:
2
∑ (X
n
s2 =
i =1
− X)
2
i
n −1
⎛ n
⎞
X
⎜
⎟
∑
i
n
i =1
⎝
⎠
2
Xi −
∑
n
= i =1
.
(n − 1)
Recall that:
Z=
X −µ
~ N(0,1)
σ
n
⎞ is estimated with ⎛ s x
⎞ , then:
When the standard error of the population mean ⎛⎜ σ
⎟
⎜
⎟
n⎠
n⎠
⎝
⎝
X −µ
~ tα,v=n-1
sx
n
Properties of the t-distribution
1. Symmetric about zero
2. Leptokurtic: there’s more values around the mean than in the tails.
3. Family of distributions: There’s a different t-distribution for every degree of freedom.
4. As n → ∞, t → Z ~ N(0,1).
1
Hypothesis Testing Concerning the Mean
Because of the properties of the t-distribution, we can test if a population mean is significantly
different from a hypothesized population mean. This procedure is called the “one sample t-test.”
Since the t-distribution is symmetrical, we can perform two-tailed or one-tailed tests of
hypotheses. In both cases, the general procedure is to compute a t-value >>> t =
X −µ
then
sx
n
compare it to a critical t-value >>> tα,v=n-1.
Example: We want to test if the mean distance in a random sample of distances is significantly
different from the hypothesized population mean. Given that X = 850.0 cm, s x = 25.0 cm, and n
= 31, test the following hypothesis:
Ho: µ = 855 cm
Ha: µ ≠ 855 cm
>>> NOTE: This is a two-tailed test
α = 0.05
First, calculate SE: s x =
Then, t =
sx
n
=
25
31
= 4.49 cm
X − µ 850 − 855
=
= −1.1136
sx
4.49
n
and tα,n-1 = t0.05(2),30 = 2.042 (see Table B.3).
Decision Rule: If | t | ≥ 2.042, then reject Ho; otherwise, do not reject. (Note that absolute value
brackets are used for the two-tailed test)
Conclusion: Since | -1.1136 | < 2.042 (0.20 < P < 0.50), do not reject Ho.
2
Example: We could also perform a one-tailed test to determine if the mean distance in the
previous example is significantly less than or equal to the hypothesized population mean:
Ho: µ ≥ 855 cm
Ha: µ < 855 cm
α = 0.05
The t-value is the same, but we will use a different critical t-value: t0.05(1),30 = 1.697
Decision Rule: If t ≤ -1.697, then reject Ho; otherwise, do not reject.
Conclusion: Since -1.1136 > -1.697 (0.10 < P < 0.25), do not reject Ho.
For one-tailed tests in general,
1.) When Ho: µ ≥ µo and Ha: µ < µo, and if t ≤ − t α (1),ν , then reject Ho.
2.) When Ho: µ ≤ µo and Ha: µ > µo, and if t ≥ t α (1),ν , then reject Ho.
Confidence Intervals for the Population Mean
In a population with a mean, µ, α% of all possible sample means, X , have t-values that range
between ± tα(2), υ:
⎡
⎤
X −µ
P ⎢− t α (2 ),ν ≤
≤ t α (2 ),ν ⎥ = 1 − α
sx
⎣
⎦
Thus, the probability that the population mean will fall within a specified interval defined by the
sample is:
P[X − t α (2 ),ν s x ≤ µ ≤ X + t α (2 ),ν s x ] = 1 − α
This “confidence interval” can be stated more succinctly as:
X ± t α (2 ),ν s x
3
Example: Using our previous example, let’s compute the 95% confidence interval for the mean.
Given, x = 850.0 cm, and s x = 4.49 cm , the interval is:
X ± t 0.05(2 ),30 s x = 850 ± (2.042)(4.49) = 850 ± 9.17 cm .
Note that any value for the mean within this interval is one which would not be rejected as a
hypothesized value for µ in a hypothesis test with α = 0.05.
Determination of Sample Size for Estimation of the Population Mean
Often, we wish to know how many samples, n, are necessary to achieve a desired level of
precision. If we have an estimate of the sample variance, s 2x , we can calculate the required
sample size as:
n=
t α2 (2 ),ν ∗ s 2x
d2
,
where: d = the half-width of the desired confidence interval and all other variables are defined as
before.
Example: Again using our previous example, let’s determine the sample size necessary to be
within ± 6 cm with 95% confidence. Given that s x = 25.0 cm and the initial sample size = 31, we
find our desired n by:
n=
t 02.05(2 ),30 ∗ 25 2
62
2.042 2 ∗ 25 2
=
= 72.4 or 73 samples (we always round up).
62
4
Obviously, we need an initial value for n (for the t-value) to find the final value of n. This may
seem like circular reasoning. However, one can circumvent this problem by calculating n
iteratively.
Power and Sample Size in Tests Concerning the Mean
If we want to perform a one-sample hypothesis test, then we may want to know exactly how
many samples we need to collect to detect a specified difference with a specified power. Again,
we can estimate n if we have a reliable estimate ( s 2x ) of the population variance (σ2). If we want
to calculate n to detect a minimum difference between the population mean and a specified mean
for a given α-level (probability of committing a Type I error) and β-level (probability of
committing a Type II error), we use the formula:
n=
s 2x
(t α,ν + t β(1),ν )2
2
δ
Example: Again using our previous example, let’s say we wanted to test at the α = 0.05 level
with a 90% chance of detecting a population mean different from 850.0 cm by as little as 10.0
cm. Then,
n=
25 2
25 2
2
(
)
(2.042 + 1.310)2 = 70.2 or 71 samples.
+
=
t
t
0.05 ( 2 ), 30
1− 0.90 = 0.10 (1), 30
2
2
10
10
By rearranging the above equation, we can also ask how small a difference, δ, we can detect by
the t-test at a specified α-level with 1-β power:
5
δ=
s 2x
(t α,ν + t β(1),ν )
n
Example: Again using our previous example, we can ask what the minimum detectable
difference is while testing at the 0.05 level with 0.90 power and n = 31 samples:
δ=
25 2
(t 0.05( 2),30 + t 0.10(1),30 ) =
31
25 2
(2.042 + 1.310) = 15.1 cm
31
By again rearranging the earlier equation, we can also determine the power of our test (1 – β) to
detect a specified minimum difference at a specified α-level:
t β (1),ν =
δ
s 2x
− t α ,ν
n
The resulting t-value is then converted to β using Table B.3 in the appendix.
Example: Again using our previous example, let’s calculate the power of our t-test to detect a
minimum difference of 5 cm at the 0.05 level:
t β (1),30 =
5
25 2
− t 0.05( 2 ),30 =
31
5
25 2
− 2.042 = −0.92845
31
Since β is always a one-tailed test with a positive value, we know from Table B.3 that β falls in
the interval: 0.10 < β < 0.25. So, the power of the test is in the interval: 0.75 < 1-β < 0.90.
Zar notes that the above calculation results only in a “rough” estimate β. β can also be
approximated by Zβ(1). Given a sample size, n, smaller α-levels result in greater β-levels.
6
However, α and β can both be lowered by increasing n. Power is also greater for one-tailed tests
than two-tailed tests. Power is also greater when s 2x is smaller.
Confidence Intervals for the Population Variance
As with populations means, confidence intervals can be constructed for the population variance,
σ2. In the case of variances, however, the sampling distribution is not symmetrical (as it is for
means >>> the sampling distribution for means approaches a normal distribution as n increases).
Thus, we cannot use t-values or z-values to build confidence intervals or tests hypotheses for σ2 .
But, we can use the chi-square distribution to build confidence intervals for σ2 :
νs 2x
νs 2x
2
≤σ ≤ 2
χ α2 ν
χ1− α ν
2,
2,
Example: Still using our ongoing example, we can create a confidence interval for the variance:
30 ∗ 25 2
30 ∗ 25 2
2
≤σ ≤ 2
χ 0.05
χ 20.05
2
= 0.025, 30
1−
2
= 0.975, 30
30 ∗ 25 2
30 ∗ 25 2
2
⇒
≤σ ≤
⇒ 399.1 ≤ σ 2 ≤ 1,116.7 cm 2
46.979
16.791
Hypothesis Testing Concerning the Variance
We can also test one and two-tailed hypotheses concerning the variance by calculating a chisquare statistic, χ 2 =
νs 2x
, and comparing to a critical chi-square value. We will demonstrate
σ o2
the procedure by way of examples.
7
Example: Again using our previous example, we have s x = 25 cm , n = 31. Let’s test the twotailed hypothesis at α = 0.05:
Ho: σ2 = 300 cm2
Ha: σ2 ≠ 300 cm2.
Test Statistic: χ 2 =
30 ∗ 252
= 62.5
300
Decision Rule: If χ 2 ≥ χ 20.05
2
= 0.025 , 30
= 46.979 or χ 2 ≤ χ 2
1−
0.05
= 0.975 , 30
2
= 16.791 , then reject Ho;
otherwise do not reject.
Conclusion: Since 62.5 ≥ 46.979, reject Ho (P < 0.001). We could have also rejected Ho based
on our confidence interval calculated above (300 does not fall in the range), though we could not
know the p-value.
Example: Again using our previous example, let’s test the one-tailed hypothesis at α = 0.05:
Ho: σ2 ≤ 300 cm2
Ha: σ2 > 300 cm2.
Test Statistic: χ 2 =
30 ∗ 252
= 62.5
300
Decision Rule: If χ 2 ≥ χ 02.05,30 = 43.773 , then reject Ho; otherwise do not reject.
Conclusion: Since 62.5 ≥ 43.773, reject Ho (P < 0.001).
8
Example: Again using our previous example, let’s test the other one-tailed hypothesis:
Ho: σ2 ≥ 300 cm2
Ha: σ2 < 300 cm2
α = 0.05.
30 ∗ 252
Test Statistic: χ =
= 62.5
300
2
Decision Rule: If χ 2 ≤ χ12−0.05=0.95,30 = 18.493 , then reject Ho; otherwise do not reject.
Conclusion: Since 62.5 > 18.493, do not reject Ho (P > 0.999).
Power and Sample Size in Tests Concerning the Variance
We can calculate power and the necessary n for a given precision in an analogous fashion as that
for the mean by employing the chi-square distribution. See Zar (page 124) for examples, though,
because we will not go over any in class.
Wrap-up
Zar has several other sections that describe hypothesis testing of other sample statistics
(coefficient of variation, median, symmetry, kurtosis) that we will not cover in this class.
9
Related documents