Tests of Hypotheses
Tests of Hypotheses
Tests of Hypotheses
6.1 Terminology
Examples:
One-sample test Two-sample test
Examples:
One-sided tests:
Ho: μ = 100 Ho: μ = 100 Ho: μ1 - μ2 = 0 Ho: μ1 - μ2 = 0
Ha: μ > 100 Ha: μ < 100 Ha: μ1 - μ2 > 0 Ha: μ1 - μ2 < 0
Ha: μ1 > μ2 Ha: μ1 < μ2
Two-sided tests:
Ho: μ = 100 Ho: μ1 = μ2 or Ho: μ1 - μ2 = 0
Ha: μ 100 Ha: μ1 μ2 or Ha: μ1 - μ2 0
1. Specify the hypothesis you wish to support. Remember this will give a
range of possible values for the parameter being tested and will be
expressed as an inequality in the alternative hypotheses.
Example: Ha: μ > 75
3. For Ho, choose the value of the parameter that is nearest in value to those
specified in Ha.
Example: μ = 75
Ho: μ = 75.
1. We choose between two mutually exclusive propositions, (Ho vs. Ha) about
a population parameter.
2. We use the sample to infer about the population parameter. Thus, we are
faced with the uncertainty inherent in sampling from a population with only
the sample evidence on which to base the choice of accepting Ho.
4. We reject Ho on the basis of only a reasonable doubt about its truth. Thus,
the probability value upon which we base our conclusion that there is
reason to doubt the truth of H o, is critical. (We attempt to show that the
sample is inconsistent with Ho: If Ho is true, the sample represents a rare
event.)
Ho is true Ho is false
Accept Ho Correct decision Type II error
Note:
Test statistic - a random variable used to determine how close a specific sample
result falls to one of the hypotheses being tested.
1. Critical region - or rejection region, the set of values of the test statistic that
will lead to rejection of Ho.
2. Acceptance region - the set of values of the test statistic that will lead to
nonrejection of Ho.
Critical value of the test statistic - that value which separates the critical region
from the acceptance region.
Example: Suppose the test statistic is Z and the criterion used to decide
whether to reject or not reject Ho is:
The critical region is the set of values in the interval [zα, ].
Thus:
If calculated z zα, reject Ho. If z > zα, P(Z zα) < α.
If z = zα, P(Z zα) = α.
Observed significance level (or p-value) - for a specific statistical test is the
probability (assuming Ho is true) of observing a value of the test statistic that is at least
as contradictory to the null hypothesis, and supportive of the alternative hypothesis, as
the one computed from the sample data; the probability of observing a value as large
as that computed based on sample evidence assuming that the null hypothesis is true.
Example: Suppose the test statistic is Z and the computed value of Z from the
sample observations is 3.67. The p-value for this test will be determined as follows:
a. Ha: μ > μo
b. Ha: μ < μo
61
c. Ha: μ μo
3. Test statistic: Z
xμ
z is a Z value, Z ~ N(0, 1)
σ/ n
Note:
P(Z zα) = 1 - α
At α = 0.01:
P(Z z0.01) = 1 - 0.01 = 0.99
P(Z z0.01) P(Z 2.33) = 0.99 z0.01 2.33
At α = 0.05:
P(Z z0.05) = 1 - 0.05 = 0.95
P(Z 1.645) = 0.95 z0.05 = 1.645
Note:
-zα is just the negative of zα
-z0.01 = -2.33
-z0.05 = -1.645
Note:
At α = 0.01: (α/2 = 0.01/2 = 0.005)
P(Z > z0.005) = 0.005
P(Z < z0.005) = 0.995
z.005 = 2.575
5. Conclusion:
62
Example:
This policy was tried on a class of 25 students and at the end of the
semester, the students were given the standardized test. Over the years, the
professor had established that the scores on the test are normally distributed
with a mean of 75 points and a standard deviation of 15 points. The sample
results show that x = 86 points. Should the new policy be adopted? Use α =
0.01.
Solution:
1. Ho: μ = 75 (Policy does not work.)
Ha: μ > 75 ( Policy works.)
3. Test statistic: Z
If Ho is true:
x
Z as in A.1
s/ n
A.2.2 If n is small (n < 30), test statistic is T, if distribution of X is not too different
from normal.
x
t with n – 1 degrees of freedom
s/ n
Critical Region:
a. H a : o
Reject Ho if t t,n-1
b.
Reject: H o if t t , n 1
c. Ha : o
Reject H o if t t / 2, n 1 or t t / 2, n 1 ; or
Reject H o if t t / 2, n 1
Example:
x 47 50
t 0. 8
s/ n 15 / 4
a. H a : 2 02
b. H a : 2 02
c. H a : 2 02
3. Test statistic: X2
(n 1)s 2
x2 = 2 , v = n - 1; s2 is the variance of a random sample taken from a
0
normal population having a variance of σ2
Reject Ho if X X a , v ; P(X X a )
2 2 2 2
a.
Reject Ho if X X1 / 2, v or X / 2, v
2 2 2
c.
Example:
Solution:
α = 0.05
( 24)( 2.5)
x2 15
4
Decision on Ho: Since 15 is not greater than 39.36 nor less than 12.40, do not
reject Ho
Note: A one-tailed test with Ha: σ2 < 4 min. squared can also be used since
the sample evidence supports this. This way, only one critical value need
to be identified.
3. Test statistic: F
s12
f = 2 , under Ho with v1 = n1 - 1, v2 = n2 - 1
s2
66
5. Conclusion
Example:
Two sections of a statistics course took the same long exam. A sample
was randomly drawn from each section showing the following scores:
Assuming that the scores are normally distributed, is there reason to believe that
the population variances are equal? Use α = 0.05.
Solution:
Ho: 2A 2B
Ha: A2 B2
α = 0.05
s A2 139.5111
f 0.93
s B2 150.1667
1 1
Critical values: f0.025 (9, 5) = 6.68 and f0.975 (9, 5) = = 0.22
f 0.975 (5.9) 4.48
Decision on Ho: Since 0.93 is in the acceptance region, do not reject Ho. There is no
sufficient evidence to indicate that the variances are not equal.
Note: For practical purposes, it is best if one uses the one-tailed test biased to f > 1, or
with the numerator larger than the denominator. This way, the critical value is
easily found. This simply means computing the f ratio such that the larger
sample variance is the numerator.
6.8 Tests of Hypotheses on the Equality of Means
A.1 Test of equality of means when σ12 and σ22 are known, independent samples
3. Test Statistic: Z
2 2
X1 X 2 approximately normal 1 2 , 1 2
n1 n 2
x1 x 2 μ 1 μ 2
Z under H o is the standard normal Z
σ 12 σ 22
n1 n2
Example:
Solution: The two samples can be taken to be independent and coming from
large populations.
σ2 σ2
X A X B approximately Normal μ A μ B , A B
n A n B
1. Ho: A - B = 0
Ha: A > B or A - B > 0
3. Test statistic: Z
5. Conclusion: There is reason to believe that manufacturer A’s picture tubes have a
mean lifetime greater than those of manufacture B at the 5% level of
significance.
68
A.2 Test of equality of means when σ21 and σ22 are unknown and σ21 σ22 based on
test on equality of variances; independent samples (we estimate σ21 and σ22 by s22
and s22, respectively)
( x 1 x 2 ) ( 1 2 )
Z
s 12 s 22 , as in A.1’s C.R., Section 6.6
n1 n2
A.2.2. If n1 < 30 and n2 < 30, test statistic is T. Assume X1 and X2 are both
Normal.
x 1 x 2 ) ( 1 )
t
s12s2 with v d.f.
2
n1 n 2
2
s 12 s 22
n
1 n2
v 2
s s2
( 1 )2 ( 2 )2
n1 n
2
n1 1 n 2 1
A.3 Test of equality of means when 12 and 22 are unknown and 12 = 22 based
on test of equality of variances. (We estimate 12 by s 12 and 22 by s 22 .)
x 1 x 2 ) (μ 1 μ 2
Z
1 1
sp
n1 n 2
(n 1 1)s 12 (n 2 1)s 22
s p2 , pooled variance
n1 n 2 2
From:
σ2 σ2
σ x1 x2 , σ 12 σ 22 σ 2
n1 n 2
1 1
= σ2( )
n1 n 2
69
1 1
=
n1 n 2
1 1
σ̂ x1 x 2 s p since
ˆ sp
n1 n 2
A.3.2. If n1 < 30 and n2 < 30, test statistic is T. Assume X1 and X2 are both
Normal.
x1 x 2 μ 1 μ 2
t with v n 1 n 2 2
1 1
sp
n1 n 2
Examples:
Solution:
Ho: μB = μG
Ha: μG > μB
(xG x B ) 0 75 72 3
Z 1.73
2
sG s2 36 64 1.7321
B
nG nB 36 32
Conclusion: The girls are better in spelling than the boys at the 5% level of
significance.
Cassava starch 161 166 170 165 172 168 157 164 165.375 4.8385
Cassava powder 152 147 157 146 155 157 148 155 152.125 4.5493
Solution:
Assumptions:
1. independent random samples
2. sampled populations are normal (since sample sizes are small)
( x B x p ) 0 165.375 152.125
t 5.643
1 1 1 1
sp 4.6961229
n1 n 2 8 8
= 22.053571
Ho: μ1 = μ2 or μD = 0
d μD
t with v n 1 , n pairs of observations
sd
n
(d i d ) 2 nd 12 d i 2
s d2 , d i x1i x 2i
n 1 n(n 1)
Σd i
d
n
71
Σ( x 1i x 2 i )
=
n
= x1 x 2
t = z if n is large
Example:
1 2 3 4 5 x
F 2.0 2.0 2.3 2.1 2.4 2.16
NF 2.2 1.9 2.5 2.3 2.4 2.26
Assuming that the populations are normal, test at the 0.025 level of significance
whether membership in a fraternity is detrimental to one's grades.
Ho: μ1 = μ2 or μD = 0
Ha: μ1 < μ2 or μD < 0
α = 0.025
Test statistic: T
d μD 0.1 0
t 1.581
sd 0.1414214
n 5
d x F x NF 0.1
2 ( 5)(0.13) ( 0.5) 2
sd 0.02 , s d 0.14142135623
( 5)( 4)
Decision: Since | t | is not greater than t.025,4 = 2.776, do not reject Ho.
computed based on sample values and desired confidence level (say, 95% or
99%).
σ σ
μ (X zα / 2 , X zα / 2 )
n n
Proof:
Xμ
P( z a / 2 zα / 2 ) 1 α
σ
n
σ σ
zα / 2 X μ zα / 2
n n
σ σ
X zα/ 2 μ X z α / 2
n n
σ σ
P( X z α / 2 μ X zα/ 2 ) 1 α
n n
In repeated sampling, if the 95% C.I. were constructed for all the sample
means, 5% of these intervals would not contain μ, 95% will cover μ.
S S
μ (X t α / 2 v , X t α / 2v )
n n
Proof:
Xμ
P( t α / 2,n 1 T t α / 2,n 1 ) 1 α , T
S/ n
S S
P( X t α / 2 , v μ X t α / 2, v ) 1α
n n
73
Examples:
σ σ
X z 0.01 / 2 X z 0.05 / 2
n n
15 15
86 ( 2.575) 86 (1.96)
5 5
86 7.725 86 5.88
99% C.I. on μ:
s
47 t 0.01 / 2,15
n
15
47 ( 2.947)
4
47 11.05125
B. Confidence Interval on σ2
(n 1)S 2 (n 1)S 2
σ2 , 2
X2 X 1 a / 2, v
α / 2 , v
Proof:
P( X 12 a / 2, v X 2 X α2 / 2, v ) 1 α .
74
95% C.I. on σ2
In addition to the X2 test for the population variance in Section 6.7, there are
two other uses of the X2 test included in this chapter.
Ho: The k independent samples do not differ among themselves with respect
to the other factor. or
Example:
Ho: The two groups of farmers do not differ among themselves in terms of
tenure status. or
Test statistic: X2
r k (o ij e ij ) 2
x2 e ij
, df (k 1)(r 1)
i 1 j1
where:
eij = expected frequency in the (i, j)th cell under Ho (i.e., if the two
factors are independent)
(ri )(k j )
e ij
n
Derivation:
eij = P (an element belongs to the ith level of the first factor and jth level of
the
second) x n
k j r
= i n
n n
Note:
r k (| o ij e ij | 0.5) 2
X 2 (corrected) e ij
i 1 j1
Example:
No. of Farmers
Tenure Status Total
Adoptor Nonadoptor
Owner Operator 102 26 128
Share-rent farmer 42 10 52
Fixed-rent farmer 4 3 7
Total 148 39 187
Ho: The two groups of farmers do not differ among themselves in terms of
tenure status. Adoption and tenure status are independent.(Ratio of
adoptor to nonadoptor remains the same for all three tenure status.)
Ha: The two groups of farmers differ among themselves in terms of tenure
status. Adoption and tenure status are related. (Ratio of adoptor to
nonadoptor does not remain the same for the three tenure status.)
α = 0.05
Test Statistic: X2
77
r1 k 1 (128)(148)
e 11 101.3
n 187
r1 k 2 (128)(39)
e12 26.7
n 187
r2 k 1 (52)(148)
e 21 41.2
n 187
r2 k 2 (52)( 39)
e 22 10.8
n 187
r3 k 1 (7 )(148)
e 31 5.5
n 187
r3 k 2 ( 7)( 39)
e 32 1.5
n 187
Note: Test requires that fewer than 20% of the 6 cells should have an eij < 5.
20% of 6 = 1.2
Since e32 < 5, there is a need to merge adjacent categories. Merging the
share-rent and fixed-rent categories reduces the table to a 2 x 2.
e 11 101.3, e 12 26.7
r2' k 1 (59)(148)
e '21 46.7
n 187
0.074
Conclusion: There is no sufficient evidence to indicate that the two factors are
related.
B. X2 Goodness-of-fit Test
3. Test statistic: X2
k (o i e i ) 2
x2
i 1 ei
where:
Note:If the ois are close to the eis, the x2 value will be small.
This implies a good fit. Hence, we do not reject Ho.
We proceed with the test only if the eis are each at least equal to 5.
If not, one needs to combine adjacent cells to increase the eis.
Reject Ho if X2 X2α,v.
Thus: The number of df is equal to the number of cells minus the number
of quantities obtained from the observed data which are used in
the calculation of the expected frequencies.
5. Conclusion
2. α = 0.05
3. Test statistic: X2
Frequency Face
1 2 3 4 5 6 T
Observed 20 22 17 18 19 24 120
79
Expected 20 20 20 20 20 20
( 20 20) 2 ( 24 20) 2
x2 ... 1. 7
20 20
Example 2:
2. α = 0.05
3. Test statistic: X2
k (o i e i ) 2
x2
i 1 ei
where:
ei = P(z1 < Z < z2) x n;
z1 = z value of lower class boundary and
z2 = z value of upper class boundary
That is, ei is obtained from a normal curve having the same mean and
standard deviation as the sample ( = 3.4125, s = 0.6818 for this data
set).
Class Boundaries oi ei
1.45 – 1.95 2 0.56
1.95 – 2.45 1 2.532
2.45 – 2.95 4 6.76
2.95 – 3.45 15 10.944
3.45 – 3.95 10 10.532
3.95 – 4.45 5 6.02
4.45 – 4.95 3 2.09
Total 40 39.438
1.45 3.4125
z 1 z value of lower limit of first class 2.878
0.6818
80
1.95 3.4125
z 2 z value of upper limit of first class 2.145
0.6818
P(an observation lies in the first class) =P(-2.878 < Z < -2.145)
=P(2.145 < Z < 2.878)
=P(Z < 2.878) – P(Z < 2.145)
=0.9980 – )
= 0.9980 – 0.9840
= 0.014
Thus, e1 (0.014)(40) 0.56.
Combining adjacent classes (first three classes and last two classes,
respectively) to satisfy the requirement all ei :