You are on page 1of 6

Statistical Hypothesis Testing

HY POTHESIS TESTING
FOR CATEGORICAL DATA

COMPARING TWO PROPORTIONS

Proportion
Group
1 p1
2 p2

Hypotheses To Test

H0:=2 vs (i) Ha: 1 2 (ii) Ha: : 1 > 2 (iii) Ha: : 1 < 2

p i x (1  pi )
 Variance for the sample proportion , Var(pi) = ; i  1,2
ni

 Variance for the difference between two proportions,

p1 x (1  p1 ) p 2 x (1  p 2 )
Var(p1-p2) = 
n1 n2

Using The First Alternative Hypothesis

 Check Before Using The Normal Approximation To the Binomial

distribution

Group 1 Group 2
nmin 52 12
Sample size 78 65

1
Statistical Hypothesis Testing

For each group, the sample size is greater than nmin. Therefore, we can
use the normal approximation.

Calculations From Sample Data


1. Group Variance

Group Sample Variance


Group 1 0.00145
Group 2 0.00359

2. Variance And Standard Error For Difference Between Two


Proportions

Variance for difference between proportions 0.00504

Standard error for difference between proportions 0.0710

(0.87  0.63)
3. Standard Normal Variate, Z   3.40
0.0710

Decision Rule

 Using = 0.05 as our level of significance, our critical value for the

standard normal distribution is 1.96.

 Therefore:

We will reject the null hypothesis if |Z| > 1.96.


We will accept the null hypothesis if otherwise.

2
Statistical Hypothesis Testing

Conclusion

 Since Z = 3.40 which is greater than 1.96 we reject H0.

Using the Second Alternative Hypothesis

 At the 5% level of significance, our normal critical value is 1.645.

 Therefore:

We will reject the null hypothesis if Z > 1.645.

We will accept the null hypothesis if otherwise.

Conclusion

 Since Z = 3.40 > 1.645 we reject H0.

3
Statistical Hypothesis Testing

The Chi-squared Test of Independence

Example 2

Results of a clinical trial comparing IRS v placebo in the treatment of

cervical osteoarthrosis ( Lewith and Machin, 1981).

IRS Placebo Total


Improvement Yes 9 4 13
in pain No 3 9 12
Total 12 13 25

Is there any association between treatment and improvement?

Test at  = 0.05.

Solution:

i. Hypotheses

H0: There is no association between treatment and improvement.


Ha: There is association between treatment and improvement.

4
Statistical Hypothesis Testing

ii. Test statistic

O  eij 
2
X²   where eij is the expected frequency for cell ij and
ij

eij

ni. x n. j
eij  .
n

 X² has an approximate Chisquared distribution with 1 df. For a 2 by 2

table, this gives a poor approximation.

 A certain correction is to be preferred. This is called Yates' correction.

The corrected statistic is X²corr.

 This is given as

o  eij  0.5  2


ij
X ² corr  .
eij

12 X 13
e11   6.24
25

12 X 12
e21   5.76
25

12 X 13
e12   6.76
25

13 X 12
e22   6.24
25

X2 corr = 3.28

X2 = 4.89> 3.84, we reject Ho. Treatment is associated with

improvement.

5
Statistical Hypothesis Testing

Since X2 corr =3.28 < 3.84, we accept Ho. Treatment is not associated with

improvement.

You might also like