From the free course AP Statistics on Lykke
3.13 Carrying Out a Test for the Difference Between Two Population Proportions
Key concepts: Pooled proportion p̂c — all successes over all observations · Pooling is justified only by H₀: p₁ = p₂ · Standard error √(p̂c(1−p̂c)(1/n₁ + 1/n₂)) for the test · z statistic — observed difference measured in standard errors · p-value — chance of a gap this extreme if the proportions were equal · Decision at α — reject or fail to reject, never accept H₀
When we test whether two populations have the same proportion of a specific characteristic, we operate under the foundational assumption of the null hypothesis: $H_0: p_1 = p_2$.
When we test whether two populations have the same proportion of a specific characteristic, we operate under the foundational assumption of the null hypothesis: $H_0: p_1 = p_2$. If this assumption is true, the two samples are effectively drawn from populations with a single, shared proportion. To reflect this in our mathematics, we combine the data from both samples to create a single combined (pooled) sample proportion, denoted as $\hat{p}_c$. This pooled estimate provides a more precise calculation of the standard deviation of the sampling distribution than using the two sample proportions separately.
The pooled proportion is the total number of "successes" from both groups divided by the total number of observations. Mathematically, it is expressed as $\hat{p}_c = \frac{X_1 + X_2}{n_1 + n_2}$. This value is then used to calculate the standard error of the difference for the test statistic. Unlike confidence intervals for the difference between two proportions—where we do not assume the proportions are equal and thus do not pool—the significance test requires this pooling to remain consistent with the null hypothesis.
The Test Statistic and the Z-Curve
The z-test statistic measures how many standard deviations the observed difference in sample proportions ($\hat{p}_1 - \hat{p}_2$) falls from the hypothesized difference (usually zero). Because the sampling distribution of the difference between two independent proportions is approximately Normal (provided the Large Counts condition is met), we can use the standard Normal distribution to determine the likelihood of our results.
The formula for the test statistic is: $$z = \frac{(\hat{p}_1 - \hat{p}_2) - 0}{\sqrt{\hat{p}_c(1 - \hat{p}_c) \left( \frac{1}{n_1} + \frac{1}{n_2} \right)}}$$ A large absolute value for $z$ indicates that the observed difference is unlikely to have occurred by random sampling error alone if the null hypothesis were true.
Interpreting the p-Value
The p-value is the probability of obtaining a test statistic as extreme as, or more extreme than, the one actually observed, assuming the null hypothesis is correct. In a two-proportion test, the "extremity" depends on the alternative hypothesis ($H_a$):
- Greater than ($p_1 > p_2$): The area under the standard Normal curve to the right of the calculated $z$.
- Less than ($p_1 < p_2$): The area under the standard Normal curve to the left of the calculated $z$.
- Not equal to ($p_1 \neq p_2$): The combined area in both tails (double the area of the single tail).
Definition: p-Value for Two Proportions The probability, computed assuming $p_1 = p_2$, that the difference in sample proportions would be as far or farther from zero than the difference actually observed.
Justifying the Conclusion
A statistical conclusion is never just a "yes" or "no" answer; it is a formal judgment based on the weight of evidence. To justify a conclusion (Skill 4.G), you must compare the $p$-value to a pre-determined significance level ($\alpha$).
- Compare: Explicitly state whether the $p$-value is less than or greater than $\alpha$.
- Decide: State whether you reject or fail to reject the null hypothesis ($H_0$).
- Conclude in Context: State whether there is sufficient or insufficient evidence to support the alternative hypothesis ($H_a$) using the specific variables from the study.
Misconception Check: The "Equal Proportions" Trap
A common error is concluding that $p_1 = p_2$ when the $p$-value is large. We never "accept" the null hypothesis. A large $p$-value simply means our data is consistent with the null hypothesis; it does not prove the proportions are identical. We simply "fail to find evidence of a difference."
Worked Example: Green Packaging
A company wants to know if "Green" eco-friendly packaging increases the proportion of customers who would recommend a product. They show Group A ($n_1 = 100$) the green box and Group B ($n_2 = 100$) the standard box.
- Results: $\hat{p}_1 = 0.55$, $\hat{p}_2 = 0.40$.
- Pooled Proportion: $\hat{p}_c = \frac{55 + 40}{100 + 100} = 0.475$.
- Test Statistic: $z = \frac{0.55 - 0.40}{\sqrt{0.475(0.525)(\frac{1}{100} + \frac{1}{100})}} \approx 2.12$.
- p-value: For $H_a: p_1 > p_2$, the $p$-value is $P(Z > 2.12) \approx 0.017$.
Retrieval Check: Using the Green Packaging example above and a significance level of $\alpha = 0.05$, write the final three-part conclusion for this test. Ensure you include the comparison, the decision regarding $H_0$, and the contextual claim regarding customer recommendations.
