BSDS Slides Module 8 9 11
BSDS Slides Module 8 9 11
Modules 8,9,11: Some Important Hypothesis Testing and Associated Confidence Intervals
Under H0 ,
n
X
nX̄n = Xi ∼ Binomial(n, p0 ).
i=1
Find the critical value cα (or, kα ) and γ from the equation Ep0 (ϕ(X)) = α.
Further, under the alternative H1,3 , the above test can be generalized to
1 if nX̄n > c′α or, nX̄n < kα′ ,
γ if nX̄ = c′ ,
1 n
ϕ′ (X) = α
γ2 if nX̄n = kα′ ,
0 otherwise.
The critical values c′α , kα′ and (γ1 , γ2 ) should satisfy Ep0 (ϕ′ (X)) = α. However, note that it is not
possible to obtain four unknown quantities from one equation. Therefore, one imposes additional
restrictions to get unique solutions. One possible restriction can be γ1 = γ2 and c′α = n − kα′
(symmetric critical region).
(ii) Large sample test. By CLT,
nX̄ − np0 D
p n −−−−−−→ Z,
np0 (1 − p0 ) under H0
where Z ∼ N (0, 1).
Using this result, one can construct a large sample test for testing H0 against the possible alternatives
as follows:
1 if nX̄n > cα,LS (against H1,1 ),
nX̄n < kα,LS (against H1,2 ),
ϕLS (X) =
nX̄n > c′α,LS or nX̄n < kα,LS
′ (against H1,3 ),
0 otherwise.
1
1 1 3
Fig. 1: Power curve for the exact test ϕ against H1,1 : p > p0 with p0 = (left), p0 = (middle) and p0 = (right).
4 2 4
The critical points are now determined by solving the equation Ep0 (ϕLS (X)) = α, under the large
sample distribution of nX̄n . For example, cα,LS can be obtained to satisfy
!
nX̄n − np0 cα,LS − np0
Ep0 (ϕLS (X)) = Pp0 nX̄n > cα,LS = Pp0 p >p = α,
np0 (1 − p0 ) np0 (1 − p0 )
p
which provides cα,LS = np0 + τα np0 (1 − p0 ). Here τα is the upper-α point of N (0, 1) distribution,
i.e., τα is such that P (X ≥ τα | X ∼ N (0, 1)) = α.
Similarly, kα,LS can be obtained to satisfy
!
nX̄ − np0 kα,LS − np0
p n
Ep0 (ϕLS (X)) = Pp0 nX̄n < kα,LS = Pp0 <p = α,
np0 (1 − p0 ) np0 (1 − p0 )
p
which provides kα,LS = np0 − τα np0 (1 − p0 ), as τ1−α = −τα .
Finally, (c′α,LS , kα,LS
′ ) are such that they satisfy
′
+ Pp0 nX̄n > c′α,LS = α.
Ep0 (ϕLS (X)) = Pp0 nX̄n < kα,LS
As it is not possible to uniquely solve for (c′α,LS , kα,LS
′ ) from the above equation, we put the additional
restriction that
′
Pp0 nX̄n > c′α,LS = α/2,
Pp0 nX̄n < kα,LS = α/2, and
and obtain the solutions
′
c′α,LS = np0 + τα/2
p p
kα,LS = np0 − τα/2 np0 (1 − p0 ), and np0 (1 − p0 ).
2
1 1 3
Fig. 2: Power curve for the exact test ϕ against H1,2 : p < p0 with p0 = (left), p0 = (middle) and p0 = (right).
4 2 4
(iii) Power function. The power curve for the exact test ϕ (under the alternative H1,1 ) for three choices
of p0 ∈ { 14 , 12 , 34 } is given in Figure 1.
The power curve for the exact test ϕ (under the alternative H1,2 ) for three choices of p0 ∈ { 14 , 12 , 34 }
is given in Figure 2.
(iv) Large sample confidence interval associated with the test. The large sample test ϕLS under
the alternative H1,3 leads to a possible (large sample) confidence interval for binomial proportion p.
Under H0 : p = p0 ,
nX̄ − np0 D
p n −−−−−−→ Z,
np0 (1 − p0 ) under H0
p
where Z ∼ N (0, 1). Note that X̄n →
− p0 (by WLLN), and so by continuous mapping
s
X̄n (1 − X̄n ) p
→
− 1.
p0 (1 − p0 )
where Z ∼ N (0, 1). Based on this result one can obtain that
√ !
n(X̄n − p0 )
Pp0 −τα/2 ≤ p ≤ τα/2 ≈ 1 − α,
X̄n (1 − X̄n )
3
which is equivalent to saying
√ !
n(X̄n − p)
Pp −τα/2 ≤ p ≤ τα/2 ≈ 1 − α,
X̄n (1 − X̄n )
r r !
X̄n (1 − X̄n ) X̄n (1 − X̄n )
⇔ Pp X̄n − τα/2 ≤ p ≤ X̄n + τα/2 ≈ 1 − α.
n n
• We obtained UMP test against H1,1 and H1,2 when σ 2 is known with the test statistic X̄n .
• In the same spirit, let us construct the following test for H0 against H1,1 (or, H1,2 ) as
(
1 if X̄n ≥ cα ,
ϕ(X) =
0 otherwise.
4
• Test procedure. Based on the proposed t-statistic the test function for testing H0 against
the possible alternatives is as follows:
1
if Tn > cα (against H1,1 ),
Tn < kα (against H1,2 ),
ϕ(X) =
Tn > c′α or Tn < kα′ (against H1,3 ),
0 otherwise.
The critical points are now determined by solving the equation Eµ0 (ϕ(X)) = α, under the
distribution of Tn under H0 . In particular, cα = tα,n−1 and kα = t1−α,n−1 = −tα,n−1 , where
tα,n−1 is the upper-α point of tn−1 distribution, i.e., tα,n−1 is such that P (T ≥ tα,n−1 | T ∼
tn−1 ) = α. Further, under the additional assumption of symmetric critical region, one obtains
c′α = tα/2,n−1 and kα′ = t1−α/2,n−1 = −tα/2,n−1 ,
• The test statistic in (1) is called the student t statistic, and the corresponding test is called the
student t-test.
(ii) Power function. Define µ − µ0 = ∆. Under H0 , ∆ = 0, and under the alternatives it can take
any value in R \ {0}. The power function of the test ϕ under the alternative H11 can be derived as
follows:
√
n∆
βϕ (µ) = Pµ Tn > tα,n−1 | Tn + ∼ tn−1
σ̂n
√ √ √
n∆ n∆ n∆
= Pσ2 Tn + > tα,n−1 + | Tn + ∼ tn−1
σ̂n σ̂n σ̂n
√
n∆
= 1 − G tα,n−1 + ,
σ̂n
where G is the CDF of tn−1 distribution.
Similarly, one can derive the power function of ϕ under the alternatives H1,2 and H1,3 . The power
curve of ϕ under the alternative H1,3 for µ0 = 10 is given in Figure 3.
d
(iii) Large sample test. Let Tn ∼ tn distribution. Then as n → ∞, Tn −
→ Z where Z ∼ N (0, 1).
iid
To see this, let X, X1 , . . . , Xn ∼ N (0, 1). Then
D X
Tn = p 2
∼ tn ,
−1
n (X1 + . . . + Xn2 )
D
where U = V implies U, V have same distribution (U and V are not necessarily same variables).
p p
By WLLN and continuous mapping n−1 (X12 + . . . + Xn2 ) →
− 1 (verify), and therefore by Slutsky’s
D
lemma, Tn → Z where Z ∼ N (0, 1).
Based on the above results a large sample version of the above t-test can be obtained as follows:
1 if Tn > cα,LS (against H1,1 ),
Tn < kα,LS (against H1,2 ),
ϕLS (X) =
Tn > c′α,LS or Tn < kα′,LS (against H1,3 ),
0 otherwise.
The critical points are now determined by solving the equation Eµ0 (ϕLS (X)) = α, under the large
sample distribution of Tn under H0 . In particular, cα,LS = τα , kα,LS = τ1−α = −τα , and c′α,LS = τα/2 ,
′
kα,LS = τ1−α/2 = −τα/2 (the last two obtained under the additional restriction of symmetric critical
region), where τα is the upper-α point of N (0, 1) distribution.
5
Fig. 3: Power curve for H1,3 : µ ̸= µ0 with µ0 = 10.
(iv) Confidence interval. By inverting the test statistic of the exact or large sample test of H0 : µ = µ0
against H1,3 : µ ̸= µ0 , one can obtain a confidence interval for µ.
Student ID 1 2 3 4 5 6 7 8 9 10
Marks in Mock Test 45 38 40 36 41 39 35 37 42 44
Marks in Actual Test 50 42 47 38 44 43 40 42 46 47
iid 2 , σ2 , σ
(i) Setup. Let Z1 , . . . , Zn ∼ N2 (µX , µY , σX Y XY ) (i.e., Bivariate normal distribution) and Zi =
6
Xi
, for i = 1, 2, . . . , n, which implies
Yi
iid 2 iid
Xi ∼ N (µX , σX ), Yi ∼ N (µY , σY2 ) and Cov(Xi , Yi ) = σXY .
To test
H0 : µX = µY (i.e., µX − µY = 0)
against
H1,1 : µX − µY > 0 (or, H1,2 : µX − µY < 0, or, H1,3 : µX − µY ̸= 0).
(ii) Test statistic. Consider the difference of two variables Wi = Xi − Yi . By properties of bivariate
2 ), where µ
normal distribution Wi ∼ N (µW , σW 2 2 2
W = µX − µY and σW = σX + σY − 2σXY .
Therefore, the testing problem can be regarded as a special case of the testing of normal mean with
variance unknown, i.e., H0 : µW = 0 against possible alternatives.
The related test statistic is
X̄n − Ȳn
Tn = √ , (2)
σ̂W,n / n
Pn
2
where σ̂W,n = (n − 1)−1 i=1 (Xi − Yi − X̄n + Ȳn )2 .
(iii) The test statistic in (2) is called the paired t-test statistic, and the corresponding test is called the
paired t-test. Further, the assumption of same variances for the two normal populations, i.e.,
var(X1 ) = var(Y1 ) = σ 2 is called the homoscedasticity assumption.
• We obtained UMP test against H1,1 and H1,2 with the test statistic nSn2 = ni=1 (Xi − X̄n )2
P
(verify starting from Neyman Pearson’s lemma, and then by generalizing).
• In the same spirit, we can propose the following test for testing H0 against H13 .
(
1 if nSn2 ≥ cα , or, nSn2 ≤ kα
ϕ(X) =
0 otherwise.
The critical points are now determined by solving the equation Eσ02 (ϕ(X)) = α, under the
distribution of Tn under H0 . As
nSn2 H0 2
∼ χn−1 ,
σ02
7
Fig. 4: The power curve of the test function ϕ for testing H0 : σ 2 = 25 against H13 : σ 2 ̸= 25.
and obtain the solutions cα = σ02 χ2α/2,n−1 , kα = σ02 χ21−α/2,n−1 , where χ2α,n−1 is the upper-α
point of χ2n−1 distribution, i.e., χ2α,n−1 is such that P (T ≥ χ2α,n−1 | T ∼ χ2n−1 ) = α.
(ii) Power function. The power curve of the above test can be derived as
2
σ02 2
2
σ02 2
2 nSn nSn
βϕ (σ ) = Pσ2 ≥ 2 χα/2,n−1 + Pσ2 ≤ 2 χ1−α/2,n−1
σ2 σ σ2 σ
2 2
σ0 2 σ0 2
= 1−G χα/2,n−1 + G χ ,
σ 2 σ 2 1−α/2,n−1
where G is the CDF of χ2n−1 distribution. The power curve of the test function for testing H0 : σ 2 =
25 against H13 : σ 2 ̸= 25 is given in Figure 4.
(iii) Confidence interval. By inverting the test statistic of the test of H0 : σ 2 = σ02 against H1,3 : σ 2 ̸=
σ02 , one can obtain a confidence interval for σ 2 .
From the exact test above, we obtain
Pσ02 (kα ≤ nSn ≤ cα ) =Pσ02 σ02 χ21−α/2,n−1 ≤ nSn2 ≤ σ02 χ21−α/2,n−1 = 1 − α,
⇔ Pσ2 σ 2 χ21−α/2,n−1 ≤ nSn2 ≤ σ 2 χ21−α/2,n−1 = 1 − α,
!
nSn2 2 nSn2
⇔ Pσ 2 ≤σ ≤ 2 = 1 − α.
χ2α/2,n−1 χ1−α/2,n−1
8
" #
nSn2 nSn2
Therefore, , is a confidence interval for σ 2 with confidence coefficient 1 − α.
χ2α/2,n−1 χ21−α/2,n−1
• Also,
nSX2 mSY2 2 + mS 2
nSX
∼ χ2n−1 , and ∼ χ 2
m−1 , independently, implying, Y
∼ χ2n+m−2 ,
σ2 σ2 σ2
where SP 2 2 of {X1 , . . . , Xn } and {Y1 , . . . , Ym }, respectively, i.e.,
X and SY are sample variances
2 n
nSX = i=1 (Xi − X̄n )2 , mSY2 = m 2
P
j=1 j − Ȳm )
(Y
• Finally, note that all the four quantities X̄n , Ȳm , SX 2 , S2
Y are mutually independent (WHY
?), which implies that X̄n − Ȳm is independent of nSX + mSY2 .
2
9
(iii) Derive the complete test function, the power function and corresponding confidence interval based
on the test based on the above test statistic.
(iv) The test statistic in (3) is called the two-sample student t-test statistic, and the corresponding test
is called the two-sample student t-test.
(v) Finally when min{m, n} → ∞, an asymptotic version of the above test can be formed, where the
critical values are obtained from the normal distribution.
The critical points are now determined by solving the equation EH0 (ϕ(X)) = α, under the distri-
bution of Tn under H0 . In particular, cα = Fα,n−1,m−1 , kα = F1−α,n−1,m−1 , and c′α = Fα/2,n−1,m−1 ,
kα′ = F1−α/2,n−1,m−1 , where Fα,n−1,m−1 is the upper-α point of Fn−1,m−1 distribution, i.e., Fα,n−1,m−1
is such that P (F ≥ Fα,n−1,m−1 | F ∼ Fn−1,m−1 ) = α.
10
2
Fig. 5: Power function for the F-test for H0 : σX = σY2 against H1,1 : σX
2
> σY2 (top), H1,1 : σX
2
< σY2 (middle),
2 2
and H1,3 : σX ̸= σY (bottom).
11
(iv) Power function. Define σX 2 /σ 2 = σ 2 . Under H , σ 2 = 1, and other the alternative it can take any
Y 0
positive value. The power function of the test ϕ under the alternative H11 can be derived as follows:
= 1 − G Fα,n−1,m−1 /σ 2 ,
(v) Confidence interval. Based on the above test one can form a confidence interval for the ratio of
variances of two normal populations. From the test we get
nSX2 /(n − 1)
′ ′
Pσ2 /σ2 =1 kα ≤ Tm,n ≤ cα = Pσ2 /σ2 =1 F1−α/2,n−1,m−1 ≤ ≤ Fα/2,n−1,m−1
X Y X Y mSY2 /(m − 1)
= 1 − α.
2 /σ 2 (not necessarily 1), we have
For a general σX Y
nSX2 /(n − 1) σ 2
Y
Pσ2 /σ2 F1−α/2,n−1,m−1 ≤ 2 ≤ Fα/2,n−1,m−1 = 1−α
X Y mSY2 /(m − 1) σX
!
nSX2 /(n − 1) 2
σX nSX2 /(n − 1)
Pσ2 /σ2 ≤ ≤ = 1 − α.
X Y mSY2 /(m − 1)Fα/2,n−1,m−1 σY2 mSY2 /(m − 1)F1−α/2,n−1,m−1
" #
2 /(n − 1)
nSX 2 /(n − 1)
nSX
Therefore, , is a confidence interval for
mSY2 /(m − 1)Fα/2,n−1,m−1 mSY2 /(m − 1)F1−α/2,n−1,m−1
2 /σ 2 with confidence coefficient 1 − α.
σX Y
12
6 Exercises
1. Suppose that the proportion p of defective items in a large population of items is unknown, and
that it is desired to test the following hypotheses:
H0 : p = 0.2 vs H1 : p ̸= 0.2.
Suppose also that a random sample of 20 items is drawn from the population. Let Y denote the
number of defective items in the sample, and consider a test procedure ϕ such that the critical
region contains all the outcomes for which either Y ≥ 7 or Y ≤ 1.
(a) Determine the value of the power function βϕ (p) at the points p = 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6,
0.7, 0.8, 0.9 and 1; and sketch the power function.
(b) Determine the size of the test.
2. An auto manufacturer gives a warranty for 3 years for its new vehicles. In a random sample of 60
of its vehicles, 20 of them needed five or more major repairs within the warranty period. Estimate
the 95% (large sample) confidence interval of the true proportion of vehicles from this manufacturer
that need five or more major repairs during the warranty period, with confidence coefficient 0.95.
Interpret the result.
3. Suppose that a random sample of 10,000 observations is taken from the normal distribution with
unknown mean µ and known variance is 1, and it is desired to test the following hypotheses at the
level of significance 0.05:
H0 : µ = 0 vs H1 : µ ̸= 0.
Suppose also that the test procedure specifies rejecting H0 when |X̄n | ≥ c, where the constant c is
chosen so that P (|X̄n | ≥ c | µ = 0) = 0.05. Find the probability that the test will reject H0 if (a)
the actual value of µ is 0.01, and (b) the actual value of µ is 0.02.
4. A random sample of size 50 from a particular brand of tea packets produced a mean weight of
15.65 ounces and standard deviation of 0.59 ounce. Assume that the weights of these brands of tea
packets are normally distributed. Find a 95% confidence interval for the true mean µ.
5. Fifteen vehicles were observed at random for their speeds (in mph) on a highway with speed limit
posted as 70 mph, and it was found that their average speed was 73.3 mph. Suppose that from past
experience we can assume that vehicle speeds are normally distributed with σ = 3.2. Construct a
90% confidence interval for the true mean speed µ, of the vehicles on this highway. Interpret the
result.
6. Studies have shown that the risk of developing coronary disease increases with the level of obesity,
or accumulation of body fat. A study was conducted on the effect of exercise on losing weight. Fifty
men who exercised lost an average of 11.4 lb, with a standard deviation of 4.5 lb. Construct a 95%
confidence interval for the mean weight loss through exercise. Interpret the result and state any
assumptions you have made.
7. Two statistics professors want to estimate average scores for an elementary statistics course that has
two sections. Each professor teaches one section and each section has a large number of students.
A random sample of 50 scores from each section produced the following results:
13
8. Suppose that X1 , . . . , Xm form a random sample from the normal distribution with unknown mean
µ1 and unknown variance σ12 , and that Y1 , . . . , Yn form an independent random sample from the
normal distribution with unknown mean µ2 and unknown variance σ22 . Suppose also that it is
desired to test the following hypotheses with the usual F-test at the level of significance α = 0.05:
Assuming that m = 16 and n = 21, show that the power of the test when σ12 = 2σ22 is given by
P (V ≥ 1.1), where V is a random variable having the F-distribution with 15 and 20 degrees of
freedom.
9. The scores of a random sample of 16 people who took the TOEFL (Test of English as a Foreign
Language) had a mean of 540 and a standard deviation of 50. Construct a 95% confidence interval
for the population mean µ of the TOEFL score, assuming that the scores are normally distributed.
10. The following data represent the rates (micrometers per hour) at which a razor cut made in the
skin of anesthetized newts is closed by new cells.
28, 20, 21, 39, 32, 23, 18, 31, 14, 23, 18, 22, 28, 24, 33, 12, 23, 21, 25, and 25
(a) Find the 95% confidence interval for population mean rate µ for the new cells to close a razor
cut made in the skin of anesthetized newts.
(b) Find a 99% confidence interval for µ. Is the 95% CI wider or narrower than the 99% CI? Briefly
explain why.
(c) Find the 95% confidence interval for population variance σ 2 .
11. A study of two kinds of machine failures shows that 58 failures of the first kind took on the average
79.7 minutes to repair with a standard deviation of 18.4 minutes, whereas 71 failures of the second
kind took on average 87.3 minutes to repair with a standard deviation of 19.5 minutes. Find a 99%
confidence interval for the difference between the true average amounts of time it takes to repair
failures of the two kinds of machines.
12. The management of a supermarket wanted to study the spending habits of its male and female
customers. A random sample of 16 male customers who shopped at this supermarket showed that
they spent an average of $55 with a standard deviation of $12. Another random sample of 25
female customers showed that they spent $85 with a standard deviation of $20.50. Assuming that
the amounts spent at this supermarket by all its male and female customers were approximately
normally distributed, construct a 90% confidence interval for the ratio of variance in spending for
males and females, σ12 /σ22 .
13. The following information was obtained from two independent samples selected from two normally
distributed populations with unknown but equal variances.
• Sample I: 14, 15, 12, 13, 6, 14, 11, 12, 17, 19, 23.
• Sample II: 16, 18, 12, 20, 15, 19, 15, 22, 20, 18, 23, 12, 20.
Test whether the difference of the population means is equal to zero or not. Construct a 95%
confidence interval for the difference between the population means and interpret.
14