You are on page 1of 14

7/14/2015

Chapter 7 (Week 10)


Hypothesis Testing for Two
Populations
Dr.S.Rajalingam
L3: (7) Hypothesis Testing for Difference in Mean for two
populations (variance unknown and Unequal)
(8) Hypothesis Testing for Difference in means for
difference in two proportion &
(9) Hypothesis Testing for variance

7/14/2015 1

Learning Objectives

At the end of the lesson student should be able


to
 Perform the hypothesis testing for difference
in means for two normal populations (variances
unknown and Unequal)
 Perform the hypothesis testing for difference
in means for difference in two proportion

7/14/2015 2

1
7/14/2015

7.TWO VARIANCES ARE UNKNOWN AND UNEQUAL


 Test about the difference 1   2  0
Case 2:  12   22
Null Hypothesis is the same as before:

Test statistic:
( x1  x2 )  ( 1   2 )
T 
( S12 / n1)  ( S 2
2 /n )
2

But the degree of freedom is given by 

s12 s22 2
 )
(
n1 n2
  2
( s1 / n1 ) 2 ( s22 / n2 ) 2

n1  1 n2  1
If  is not an integer, round down to the nearest integer.
7/14/2015 3

TEST ABOUT TWO NORMAL MEANS WHEN TWO


VARIANCES ARE UNKNOWN & UNEQUAL

 Test about the difference 1   2  0

Case 2:  12   22

Critical region:

Alternative Hypothesis Rejection Criteria ( Reject H0)

H1 : 1   2 T  t / 2 , v or T   t / 2 , v

H1 : 1   2 T  t , v

H1 : 1   2 T   t , v
7/14/2015 4

2
7/14/2015

Confidence interval:
A 100(1   )% two sided confidence interval for 1  2
when variance is unknown & unequal:
Case 2:  12   22

s12s2
x1  x2  t / 2,  2  1   2
n1 n2

s12s2
 x1  x2  t / 2,  2
n1 n2

Value of  is from the formula earlier


7/14/2015 5

Example 1:
Two companies manufacture a rubber material intended for use in
an automotive application. 25 samples of material from each
company are tested, and the amount of wear after 1000 cycles are
observed. For company 1, the sample mean and standard deviation
of wear are
x1  20.12mg / 1000cycles and s1  1.9mg / 1000cycles
and for company 2, we obtain
x2  11.64mg / 1000cycles and s2  7.9mg / 1000cycles

Do the sample data support the claim that the two


companies produce material with different mean
wear? Assume each population is normally distributed
but unequal variances?
7/14/2015 6

3
7/14/2015

1. Identify the parameter of interest

The difference between the true average 1  2


Variances unknown and unequal

2. State the hypothesis

H 0 : 1  2  0 H1 : 1  2  0

3. Determine the appropriate test statistic

( x1  x 2 )  ( 1   2 )
T 
( S12 / n1 )  ( S 22 / n2 )
7/14/2015 7

4. Critical value given   0.01 t , v  t 0 .01, 26  2 .479


2 2
 s12 s22   (1.9) 2 (7.9) 2 
     
   n1 n2 
  25 25 
 26.77
2 2 2 2
 s12   s22   (1.9) 2   (7.9) 2 
       
 n1    n2   25    25 
n1  1 n2  1 24 24
  26

5. State the rejection region for the statistic

 Re ject H0 if T  2.479
7/14/2015 8

4
7/14/2015

6. Compute the value of the test statistic

(20.12  11.64)  0
T  5.22
2 2
(1.9) (7.9)

25 25

7. Conclusion

Decision: since T  5.22  2.479 we reject H0


Enough evidence to support that 1  2

7/14/2015 9

Example 2:
The following data represent the running times of films produced
by 2 motion-picture companies. Test the hypothesis that the
average running time of films produced by company 2 exceeds the
average running time of films produced by company 1 by 10
minutes against the one-sided alternative that the difference is less
than 10 minutes? Use   0.01 and assume the distributions of
times to be approximately normal with unequal variances.

Time
Company

X1 102 86 98 109 92

X2 81 165 97 134 92 87 114

7/14/2015 10

5
7/14/2015

1. Identify the parameter of interest

The difference between the true average 2  1


Variances unknown and unequal

2. State the null hypothesis

H 0 : 2  1  10 H1 : 2  1  10

3. Determine the appropriate test statistic

( x2  x1 )  (  2  1 )
T 
( S12 / n1 )  ( S 22 / n2 )
7/14/2015 11

4. Critical value given   0.01 t , v  t 0 .01, 7  2 .998

s12 s22 2
 )
(
n1 n2 (78.8 / 5  913.333 / 7) 2
  2   7.38
( s1 / n1 ) 2 ( s22 / n2 ) 2 (78.8 / 5) 2 / 4  (913.333 / 7) 2 / 6

n1  1 n2  1

5. State the rejection region for the statistic

 Re ject H0 if T  2.998

7/14/2015 12

6
7/14/2015

6. Compute the value of the test statistic

( x2  x1 )  (  2  1 )
T 
( S12 / n1 )  ( S 22 / n2 )
(110  97.4)  10
  0.22
78.8 / 5  913.333 / 7

7. Conlusion

Decision: since T  0.22  2.998 , we fail to reject H0


Not enough evidence that 2  1  10

7/14/2015 13

8.TEST FOR TWO PROPORTIONS


 Test Problems about two proportions:
Null Hypothesis: H 0 : p1  p2 (or H 0 : p1  p2 , H 0 : p1  p2 )
Test statistic:
p̂1  p̂ 2 X1 X X  X2
Z ; p̂1  , p̂ 2  2 , p̂  1
p̂(1  p̂)( n11  n12 ) n1 n2 n1  n 2
Z  N(0,1) when p1  p 2

Alternative Hypothesis Rejection Criteria ( Reject H0)

H1 : p1  p2 Z  z  / 2 or Z   z  / 2

H1 : p1  p2 Z  z
H1 : p1  p2 Z   z
7/14/2015 14

7
7/14/2015

Confidence interval:
A 100(1   )% two sided confidence interval for p1  p2 is:

pˆ 1 (1  pˆ 1 ) pˆ 2 (1  pˆ 2 )
LL  ( pˆ 1  pˆ 2 )  z / 2 
n1 n2
pˆ 1 (1  pˆ 1 ) pˆ 2 (1  pˆ 2 )
UL  ( pˆ 1  pˆ 2 )  z / 2 
n1 n2

LL  p1  p2  UL

7/14/2015 15

Example 3:
In a study on the effects of sodium restricted diets on hypertension, 24
out of 55 hypertensive patients were on sodium restricted diets, and 36
out of 149 non-hypertensive patients were on sodium restricted diets.
i. Test the hypothesis that the proportion of patients on sodium
restricted diets is higher for hypertensive patients at a=0.05.
ii. What is the P-value for this test?
iii. Construct a two sided 95% CI and comment.
Solution
Step 1 Problem: Test about two proportions large samples
Step 2 H0 : p A = p B H1 : p A > p B

Step 3 Determine the appropriate test statistic

pˆ A p ˆB
Z  N(0,1) if p A  p B
ˆ (1  p
p ˆ )( n1A  1
nB )
XA XB X A  XB
ˆA 
where p ˆB 
, p ˆ 
, p
nA nB n A  nB
7/14/2015 16

8
7/14/2015

Step 4 Critical value given   0.05, z  = z 0.05 = 1.645

Step 5 Rejection region for the statistic


 Re ject H 0 if Z  1.645

Step 6 Compute the value of the test statistic:

n A  55, nB  149, x A  24, xB  36, pˆ A  0.44, pˆ B  0.24


0.44  0.24 24  36
 z0   4.9455 , where pˆ   0.29
1 1  55  149
0.30(1  0.30)  
 55 149 

7/14/2015 17

Step 7. Conclusion

Since z0 > 1.65, then we reject H0. It means that enough


evidence to claim that the proportion of patients on
hypertension is higher than non hypertension patients

7/14/2015 18

9
7/14/2015

Example 4
A vote is to be taken among residents of a town and the
surrounding county to determine whether a proposed chemical
plant should be constructed. If 120 of 200 town voters favour the
proposal and 240 of 500 county residents favour it, would you
agree that the proportion of town voters favouring the proposal is
higher than the proportion of county voters? Use   0.05
Solution
Step 1 Problem: Test about two proportions large samples
Step 2 H0 : p 1 = p 2 H1 : p 1 > p 2
Step 3 Determine the appropriate test statistic

pˆ1 p ˆ2
Z  N(0,1) if p1  p 2
ˆ (1  p
p ˆ )( n11  1
n2 )
X1 X2 X  X2
ˆ1 
where p ˆ2 
, p ˆ  1
, p
n1 n2 n1  n 2
7/14/2015 19

Step 4 Critical value given   0.05 z  = z 0.05 = 1.645

Step 5 Rejection region for the statistic


 Re ject H 0 if Z  1.645
Step 6 Compute the value of the test statistic:
X 1  120 , X 2  240 , n1  200 , n 2  500
pˆ1 p ˆ2
Z  N(0,1) if p1  p 2
ˆ (1  p
p ˆ )( n11  1
n2 )
X1 X2 X  X2
ˆ1 
where p ˆ2 
, p ˆ  1
, p
n1 n2 n1  n 2

120 240 ˆ  120  240


pˆ1  , pˆ 2  , p
200 500 200  500

 Z  2.9
7/14/2015 20

10
7/14/2015

Step 7. Conclusion

Decision: since Z  2.9  1.645 , we reject H0 and agree


that the proportion of town voters favouring the proposal is
higher than the proportion of county voters.

7/14/2015 21

9.TEST FOR TWO VARIANCES


 Test Problems about two variances:
H 0 :  12   22 vs H1 :  12   22 or
H1 : 12   22 , or
H1 : 12   22
s12
Test statistic: F0  2
s2

Alternative Hypothesis Rejection Criteria ( Reject H0)


H1 :  
2
1
2
2
F0  f  / 2,n1 1,n2 1 or F0  f1 / 2,n1 1,n2 1

H1 : 12   22 F0  f  ,n1 1,n2 1

H1 : 12   22 F0  f  ,n1 1,n2 1
7/14/2015 22

11
7/14/2015

Confidence interval:
A 100(1   )% two sided confidence interval for  12   22 is:

s12  12 s12
f
2 1 / 2, n2 1, n1 1
 2  2 f  / 2,n2 1,n1 1
s2  2 s2

7/14/2015 23

Example 5
A random sample of 12 air pollution index at UTP station produced a
variance 0.0340 while a random sample of another 13 air pollution index
at Tronoh station produced a variance 0.0525.

i. Are the population variances equal?. Use a = 0.05.


ii. Find the 95% two-sided confidence interval on the ratio of two
variances.
Solution
Step 1 Problem: Test about two population variances

Step 2 H 0 :  12   22 vs H1 :  12   22

Step 3 Determine the appropriate test statistic

s12
F0  2
s2
7/14/2015 24

12
7/14/2015

Step 4 Critical value a=0.05, fa/2, 12,13 = 3.15

Step 5 Rejection region: Reject H 0 IF


1 1
F0  f 0.025,12,13  3.15 or F0  f 0.975,12,13  (Re ciprocal)   0.32
f 0.025,12,13 3.15

Step 6 Compute the value of the test statistic:

s12 0.0340
F0  2   0.648
s 2 0.0525
Step 7 Conclusion

Since 0.32<F0 < 3.15, then we fail reject H0. It means that not
enough evidence to say that the variances of the two pollution
indexes are different.

7/14/2015 25

Confidence interval:
A 95% two sided confidence interval for  12   22 is:

s12  12 s12
f 1 / 2 , n2 1, n1 1   2 f  / 2 , n2 1, n1 1
s 22  22 s2
s12 1  12 s12
  2 f  / 2 , n2 1, n1 1
s 22 f  / 2 , n2 1, n1 1  22 s2
0.0340 1  12 0.0340
  (3.15)
0.0525 3.15 2 2
0.0525
 12
0.206   2.041
 22

7/14/2015 26

13
7/14/2015

 END

7/14/2015 27

14

You might also like