You are on page 1of 8

STAT2006 Basic Concepts in Statistics and Probability II

Tutorial 12 Test for equality of two means; Test for variance

April 26, 2020

1 Tests of the Equality of Two Means


• Given independent normal random variables X1 , ..., Xn ∼ N (µX , σX2
), Y1 , ..., Ym ∼ N (µY , σY2 ),
consider the null hypothesis H0 : µX = µY . Three possibilities for alternative hypothesis:

(i)µX > µY ; (ii)µX < µY ; (iii)µX ̸= µY .


2
• When σX and σY2 are unknown, assume that they are equal, consider the test statistic

X̄ − Ȳ
T =√
{[(n − 1)SX
2
+ (m − 1)SY2 ]/(n + m − 2)}(1/n + 1/m)
X̄ − Ȳ
= √ ,
Sp 1/n + 1/m
√ 2 +(m−1)S 2
(n−1)SX
where Sp = n+m−2
Y
, and it is called the pooled sample standard deviation.
The above T statistic follows the t(n + m − 2) distribution when H0 is true. The critical
regions, at a significant level α, for the three alternative hypothesis would be (i)t ≥
tα (n + m − 2), (ii)t ≤ −tα (n + m − 2), and (iii)|t| ≥ tα/2 (n + m − 2), respectively.
2
• When σX and σY2 both are known, the corresponding test statistic is

X̄ − Ȳ
Z=√ 2 2
,
σX σY
n
+ m

which is a standard normal distribution when H0 is true. In this case, the critical regions,
at a significant level α, for the three alternative hypothesis would be (i)z ≥ zα , (ii)z ≤
−zα , and (iii)|z| ≥ zα/2 .

• When the variance are unknown and unequal, as long as the sample size is large and the
underlying distributions are not highly skewed, the test statistic Z = √ 2 X̄−Ȳ 2 has
SX /n+SY /m
an approximate N (0, 1) distribution, and we obtain the critical regions analogously.

• When the variance are unknown and unequal, and the sample size is small, we need to
use Welch’s t-statistic:

1
X̄ − Ȳ
T =√ 2 ,
SX SY2
n
+ m

with degree of freedom:

2
SX SY2 2
( n
+ m
)
ν= SX4 SY4
.
n2 (n−1)
+ m2 (m−1)

then solve the critical value by interpolation:

t(ν) − t(⌊ν⌋) t(⌈ν⌉) − t(⌊ν⌋)


=
ν − ⌊ν⌋ ⌈ν⌉ − ⌊ν⌋

Then we use this modified t−statistic to derive critical regions as usual.

2 Test for Variances


Let X1 , X2 , . . . , Xn be a random sample from N (µX , σ 2 ), both µX and σX
2
are unknown. To
2 2
test H0 : σX = σ0 with signifiance level α, if the alternative hypothesis is
(n − 1)SX
2
• H1 : 2
σX > σ02 , then we reject H0 when 2
≥ χ2α (n − 1);
σ0
(n − 1)SX
2
2
• H1 : σX < σ02 , then we reject H0 when 2
≤ χ21−α (n − 1);
σ0
(n − 1)SX
2
(n − 1)SX
2
2
• H1 : σX ̸= σ02 , then we reject H0 when ≥ χ2
α (n − 1) or ≤ χ21− α (n −
σ02 2 σ02 2

1).

Let Y1 , Y2 , . . . , Ym be another random sample from N (µY , σY2 ), both µY and σY2 are unknown.
2
To test H0 : σX = σY2 with signifiance level α, if the alternative hypothesis is
2
SX
2
• H1 : σX > σY2 , then we reject H0 when ≥ Fα (n − 1, m − 1);
SY2
SY2
2
• H1 : σX < σY2 , then we reject H0 when 2
≥ Fα (m − 1, n − 1);
SX
2
SX SY2
2
• H1 : σX ̸= σY2 , then we reject H0 when ≥ F α (n − 1, m − 1) or ≥ F α2 (m − 1, n − 1).
SY2 2 2
SX
One application is that it can be used to justify the equal variance assumption in other statistical
procedures, e.g. the two sample t test for equality of means in the last tutorial.

2
3 Exercises
2
Exercise 1. Let X1 , X2 , . . . , Xn and Y1 , Y2 , . . . , Ym be two random samples from N (µX , σX )
2 2 2 2 2
and N (µY , σY ) respectively, where µX , µY , σX , σY are unknown. However, assume σY = 8.5σX .
Suppose the following set of random samples of X and Y are observed.

X Y X Y X Y X Y
10.6 15.1 8 11.2 9.3 12.4 7.5 13.5
8.1 8.4 10.1 19.8 11.7 16.3 9.3 11
8.9 16.4 10.2 17.7 10.4 18 9.3 10.4
10 15.3

(a) Construct a 95% confidence interval for µX − µY .

(b) Hence, or otherwise, test whether µX = µY , for α = 0.05 level of significance.

Exercise 2. 1 Here, let X and Y equal the blood volumes inmilliliters for males who are
paraplegics participating in vigorious physical activities and males who are able bodied partic-
2
ipating in everyday activities. Assume that X was N (uX , σX ) and Y was N (uY , σY2 ). Using
n = 7 observations of X, namely,
1612, 1352, 1456, 1222, 1560, 1456, 1924
and m = 10 observations of Y , namely,
1082, 1300, 1092, 1040, 910, 1248, 1092, 1040, 1092, 1288
find a 95% confidence interval for uX − uY .

(a) Test the hypothesis that the means are equal against a two-sided alternative hypothesis.
Let α = 0.05.

(b) Did 0 belong to the 95% confidence interval? Did you reject the null hypothesis in the
current exercise?

1
“Probability and Statistical Inference” 8th ed. (Hogg and Tanis) Ch7 p.384 Ex7.3-8

3
Exercise 3.2 Let X and Y denote the tarsus lengths of male and female grackles, respectively.
2
Assume that X is N (uX , σX ) and Y is N (uY , σY2 ). Given that n = 25, x̄ = 33.80, s2x = 4.88, m =
29, ȳ = 31.66, and s2y = 5.81, test the null hypothesis H0 : uX = uY against H1 : uX > uY with
α = 0.01.

Exercise 4. Let X1 , X2 be independent random variables with uniform distribution U (θ, θ +1).
1
For testing H0 : θ = 0 versus H1 : θ = , we can use three alternative tests: (1) T1 = X1 and
2
reject H0 if T1 > c1 ; (2) T2 = min{X1 , X2 } and reject H0 if T2 > c2 ; (3) T3 = max{X1 , X2 }
and reject H0 if T3 > c3 . Find c1 , c2 , c3 such that all three tests have α = 0.05 signifiance level.
Which test is better? Provide your reason(s).

2
“Probability and Statistical Inference” 8th ed. (Hogg and Tanis) Ch7 p.385 Ex7.3-10

4
Exercise 5. Let X1 , X2 , · · · , X8 be a random sample of size n = 8 from a Poisson distribution
with mean µ. ∑
Reject the simple null hypothesis H0 : µ = 0.5 and accept H1 : µ > 0.5 if the
observed sum 8i=1 xi ≥ 8.

(a) Compute the significance level α of the test.

(b) Find the power function γ(µ) of the test as a sum of Poisson probabilities.

(c) Using the Appendix about Poisson distribution in the textbook, determine γ(0.75).

Exercise 6. 3 In may, the fill weights of 6-pound boxes of laundry soap had a mean of 6.13
pounds with a standard deviation of 0.095. The goal was to decrease the standard deviation.
The company decided to adjust the filling machines and then test H0 : σ = 0.095 against
H1 : σ < 0.095. In June, a random sample of size n = 20 yielded x̄ = 6.10 and s = 0.065.

(a) At an α = 0.05 significance level, was the company successful?

(b) What is the approximate p-value of your test?

3
“Probability and Statistical Inference” 8th ed. (Hogg and Tanis) Ch7 p.393 Ex7.4-4

5
Exercise 7.4 Let X and Y equal the times in days required for maturation of Guardiola seeds
2
from narro-leaved and broad-leaved parents, respectively. Assume that X is N (uX , σX ) and Y
2 2 2
is N (uY , σY ) and that X and Y are independent. Test the hypothesis H0 : σX /σY = 1 against
2
the alternative hypothesis H1 : σX /σY2 > 1 if a sample size n = 13 yielded x̄ = 18.97, s2x = 9.88
and a sample of size m = 9 yielded ȳ = 23.20, s2y = 4.08. Let α = 0.05.

4
“Probability and Statistical Inference” 8th ed. (Hogg and Tanis) Ch7 p.393 Ex7.4-8

6
4 Some extra exercises
The exercises below are for your reference, which relate to the remaining parts after Section
7.4.

Exercise 8.5 A particular brand of candy-coated chacolate comes in five different colors that
we shall denote as A1 ={brown}, A2 ={yellow}, A3 ={orange}, A4 ={green} and A5 ={coffee}.
Let pi equal the probability that the color of a piece of candy selected at random belongs to
Ai , i = 1, 2 · · · , 5. Test the null hypothesis

H0 : p1 = 0.4, p2 = 0.2, p3 = 0.2, p4 = 0.1, p5 = 0.1,

using a random sample of n = 580 pieces of candy whose colors yielded the respective frequencies
224, 119, 130, 48, and 59. You may select the significance level or give an approximate p=value.

Exercise 9.6 Let X equal the amount of butterfat (in pounds) produced by 90 cows during a
305-day milk production period following the birth of their first calf. Test the hypothesis that
the distribution of X is N (µ, σ 2 ), using k = 10 classes of equal probabilities. You may take
x̄ = 511.633 and sx = 87.576 as estimates of µ and σ, respectively. The data are as follows:
486, 537, 513, 583, 453, 510, 570, 500, 458, 555
618, 327, 350, 643, 500, 497, 421, 505, 637, 599
392, 574, 492, 635, 460, 696, 593, 422, 499, 524
539, 339, 472, 427, 532, 470, 417, 437, 388, 481
537, 489, 418, 434, 466, 464, 544, 475, 608, 444
573, 611, 586, 613, 645, 540, 494, 532, 691, 478
513, 583, 457, 612, 628, 516, 452, 501, 453, 643
541, 439, 627, 619, 617, 394, 607, 502, 395, 470
531, 526, 496, 561, 491, 380, 345, 274, 672, 509

5
“Probability and Statistical Inference” 8th ed. (Hogg and Tanis) Ch7 p.431 Ex8.1-2
6
“Probability and Statistical Inference” 8th ed. (Hogg and Tanis) Ch7 p.432 Ex8.1-10

7
Exercise 10. 7 In a biology laboratory, students use corn to test the Mendelian theory of
inheritance. The theory claims that frequencies of the four categories ”smooth and yellow”,
”wrinkled and yellow”, ”smooth and purple”, and ”wrinkled and purple” will occur in the ratio
9 : 3 : 3 : 1. If a student counted 125, 35, 40, 10, respectively, for these four categories, would
these data support the Mendalian theory. Let α = 0.05.

Exercise 11.8 While testing a used tape for bad records, a computer operator counted
the number of flaws per 100 feet of the tape. Let X equal this random variable. Test the null
hypothesis that X has a Poisson distribution with a mean of λ = 2.4, given that 40 observations
of X yielded 5 zeros, 7 ones, 12 twos, 9 threes, 5 fours, 1 five, and 1 six. Let α = 0.05. Hint:
combine the last two sets into one; that’s, the last set would be all x values ≥ 5.

7
“Probability and Statistical Inference” 8th ed. (Hogg and Tanis) Ch7 p.431 Ex8.1-4
8
“Probability and Statistical Inference” 8th ed. (Hogg and Tanis) Ch7 p.431 Ex8.1-7

You might also like