You are on page 1of 4

CHI-SQUARE FOR PROPORTION

Chi-square tests for equality of proportions (Two Samples)

 Comparison of two proportions - two independent samples


 Our goal is usually to estimate 𝑝1 – 𝑝2 , the corresponding confidence intervals,
and to perform hypothesis tests on:

𝐻0 : 𝑝1 – 𝑝2 = 0.

 The obvious statistic to compare the two population proportions is 𝑝 ̂1 −


̂2 Where 𝑝̂𝑖 = number of successes in group 𝑖 divided by sample size in group
𝑝
𝑖.

Probability theory tells us that:

1. 𝑝 ̂2 𝑖𝑠 the best estimate of 𝑝1 − 𝑝2


̂1 − 𝑝
2. The standard error is √𝑝1 (1 − 𝑝1 /𝑛1 + 𝑝2 (1 − 𝑝2 )/𝑛2
3. If 𝑛1 𝑝1 (1 − 𝑝1 ) > 5 𝑎𝑛𝑑 𝑛2 𝑝2 (1 − 𝑝2 ) > 5
𝑝̂1 − 𝑝̂~𝑁(𝑝
2 1 − 𝑝2 , 𝑝1 (1 − 𝑝1 )|𝑛1 + 𝑝2 (1 − 𝑝2 )|𝑛2 )

Large-sample confidence interval for 𝑝1 – 𝑝2

𝐻0 : 𝑝1 − 𝑝2 = 0 𝑣𝑠. 𝐻1 : 𝑝1 − 𝑝2 ≠ 0

Test Statistic:

𝑝
̂1 − 𝑝̂2
𝑧=
𝑆𝐸𝐻0 (𝑝
̂1 − 𝑝̂)
2

where 𝑆𝐸𝐻0 (𝑝
̂1 − 𝑝2 denotes the standard error estimates using
̂)

𝐻0 : 𝑝1 − 𝑝2 = 0 (𝑝1 − 𝑝2 )

Estimate the common 𝑝 using

𝑥1 + 𝑥2
𝑝̂ =
𝑛1 + 𝑛2

Where 𝑥1 𝑎𝑛𝑑 𝑥2 are the number of successes in groups 1 and 2, respectively.

BUENAFLOR, MADONNA C. | Chi Square for Proportion


Then,

𝑆𝐸𝐻0 (𝑝
̂1 − 𝑝2 = √𝑝̂ (1 − 𝑝̂ )(1⁄𝑛1 + 1/𝑛2
̂)

Compare Z to a Standard Normal Distribution

Example: Caries incidence

Caries by age two

N Number Percent

Controls 36 10 27.8%

intervention 68 6 8.8%

95% confidence interval:

𝑝̂1 − 𝑝̂ 2 = 0.278 − 0.088 = 0.19

0.278 0.088(1 − 0.088)


SE = √0.278 (1 − )+ = 0.082
36 68

95% confidence interval for 𝑝1 − 𝑝2 :

0.19 ∓ 1.96 ⋅ 0.082 = (0.029, 0.351)

Test:

𝐻0 : 𝑝1 − 𝑝2 = 0 𝑣𝑠. 𝐻1 : 𝑝1 − 𝑝2 ≠ 0
(10+6)
𝑝̂ = (36+68)=0.154

1 1
𝑆𝐸𝐻0 (𝑝̂1 − 𝑝̂ 2 ) = √0.154(1 − 0.154) ( + ) = 0.074
36 68

0.19
𝑍= = 2.57
0.074
𝑃 − 𝑣𝑎𝑙𝑢𝑒 = 2 × 𝑃(𝑍 > 2.57) = 0.010. 𝑅𝑒𝑗𝑒𝑐𝑡 𝑎𝑡 𝛼 = .05 𝑙𝑒𝑣𝑒𝑙

BUENAFLOR, MADONNA C. | Chi Square for Proportion


Notes on Chi-squared test:

1. Chi-square test p-values rely on Normal approximations, so they not valid


for small samples (any expected frequencies < 5).
2. Reject 𝐻0 at significance level α if the Chi-square statistic is greater than
𝛼
the 100(1- α)th percentile of the Chi-square distribution (i.e. not 2 ).
3. The null hypothesis for the Chi-square test can be equivalently formulated
as “𝑋1 is independent of 𝑋2”, where 𝑋1 𝑎𝑛𝑑 𝑋2 are the two categorical
variables being compared (gender and perio status in our example).
4. When comparing two proportions the Chi-square test is equivalent to Z-
test for two proportions.
5. The Z-test for two proportions can be formulated as a one-sided test, but
the Chi-square test cannot.

BUENAFLOR, MADONNA C. | Chi Square for Proportion


Exercises:

1. Consider the following table about consumption of alcohol for men and
women:

Consumption Yes No

female (pop.1) 68 34

male (pop.2) 86 26

2. Dormitory residency is sometimes advertised as being beneficial to students


because it helps foster a connectedness to the university and maybe help the
students develop an academic lifestyle. In one study involving 408 entering
students in 1995, students were classified according to
a. whether they lived in a campus dormitory during their first year, and
b. whether they had graduated within 6 years of entering college.

The data is presented in a 2 × 2 cross-classification table below.

Dorm Not Dorm

Grad ≤ 6 𝑦𝑒𝑎𝑟𝑠 204 20

Grad > 6 𝑦𝑒𝑎𝑟𝑠 160 24

BUENAFLOR, MADONNA C. | Chi Square for Proportion

You might also like