Comparing Two Proportions
One shared standard-error trick for the test, and a different one for the interval.
From one proportion to a difference of two
The one-proportion lesson compared a single \( \hat{p} \) to a claimed value \( p_0 \). Now the question is whether two groups have the same underlying proportion — a new drug versus a placebo, campaign A versus campaign B. Each group gives its own sample proportion, \( \hat{p}_1 \) and \( \hat{p}_2 \), and the parameter we care about is the difference \( p_1 - p_2 \).
Both the test and the interval need a standard error for \( \hat{p}_1 - \hat{p}_2 \). They are built differently, and mixing them up is the most common mistake in this topic.
The interval is a different question: it estimates \( p_1 - p_2 \), which is allowed to be anything, including nonzero. There is no shared value to assume, so pooling would be estimating a common proportion that the interval does not believe exists. The interval keeps each group's own \( \hat{p}_1 \) and \( \hat{p}_2 \) — unpooled.
Conditions for the test — checked per group
Check the Normal approximation separately for each group, not once overall:
- \( n_1\hat{p}_1 \geq 10 \) and \( n_1(1-\hat{p}_1) \geq 10 \) — group 1, using this course's \( \geq 10 \) convention.
- \( n_2\hat{p}_2 \geq 10 \) and \( n_2(1-\hat{p}_2) \geq 10 \) — group 2.
- Both samples random and independent of each other (e.g. two separate random samples, or random assignment to two groups).
- Each sample no more than 10% of its own population.
Four numbers, four checks — one group passing does not tell you anything about the other.
Why the interval cannot reuse the pooled SE
Pooling only makes sense if you are willing to assume \( p_1 = p_2 \). The interval's entire purpose is to say how big \( p_1 - p_2 \) plausibly is — including the possibility that it is not zero. Using the pooled proportion there would quietly smuggle in the test's assumption, the one the interval is supposed to be agnostic about. So the interval uses each group's own \( \hat{p}_1(1-\hat{p}_1)/n_1 \) and \( \hat{p}_2(1-\hat{p}_2)/n_2 \), added under the square root. The same per-group conditions from above apply here too.
- Conditions, per group: n1 phat1 = 45, n1(1-phat1) = 55; n2 phat2 = 30, n2(1-phat2) = 90 — all >= 10. Both samples random and independent, each under 10% of its population. Proceed.
- Pooled proportion (for the test): phat_pool = (45+30)/(100+120) = 75/220 = 0.3409.
- Pooled SE = sqrt( phat_pool(1-phat_pool) x (1/n1 + 1/n2) ) = sqrt( 0.3409 x 0.6591 x (0.01 + 0.008333) ) = sqrt(0.2247 x 0.018333) = sqrt(0.004119) = 0.06418.
- Test statistic: z = (phat1 - phat2)/pooled SE = (0.45 - 0.25)/0.06418 = 0.20/0.06418 = 3.116.
- Two-sided p-value for z = 3.116 is about 0.0018 — far below alpha = 0.05, so reject H0: evidence that p1 != p2.
- Unpooled SE (for the interval): sqrt( phat1(1-phat1)/n1 + phat2(1-phat2)/n2 ) = sqrt(0.2475/100 + 0.1875/120) = sqrt(0.002475 + 0.0015625) = sqrt(0.0040375) = 0.06354.
- 95% CI: (phat1 - phat2) +/- 1.96 x 0.06354 = 0.20 +/- 0.1245, i.e. about (0.0755, 0.3245).
- Note the two standard errors are different numbers: 0.06418 (pooled, for the test) versus 0.06354 (unpooled, for the interval). Using the wrong one shifts both the z-statistic and the interval.
WRONG (the mirror-image mistake): using the pooled standard error inside the confidence interval. RIGHT: unpooled, because the interval assumes no equality between the groups — pooling would bake in the very claim the interval is meant to be neutral about.
WRONG: \'a significant difference between two observed groups means the treatment caused it.\' RIGHT: a causal claim requires random assignment of subjects to the two groups. Without it — two groups that simply exist, like visitors who happened to see campaign A versus campaign B — a significant difference is an association, not proof of cause. See the observational-studies-versus-experiments lesson for how random assignment changes what you're allowed to conclude.
Check your understanding
- Pool the two samples' proportions for the hypothesis test, because H0: p1 = p2 assumes one shared proportion.
- Keep the two sample proportions separate (unpooled) for the confidence interval, since it estimates a difference that may not be zero.
- Check the success/failure conditions separately for each group, against each group's own p-hat, using the >= 10 convention.
- A small p-value is evidence the two proportions differ, not proof — and a difference is only a caused effect if the groups were randomly assigned.
- Statistical significance depends on sample size; a 'significant' gap can still be too small to matter in practice.