Unit 3 · Topic 3.12 Beta

Setting Up a Test for the Difference Between Two Population Proportions

3 min read · freeNot practiced

An interval estimates how far apart two proportions are. A test answers a sharper question: is there convincing evidence that they differ at all, or differ in one direction? Before computing anything, a test needs a careful setup. This topic covers the setup for comparing two proportions: the procedure, the hypotheses, the pooled proportion and the conditions.

Naming the procedure

When two groups are compared on a yes or no outcome, the parameter is a difference of two proportions, p1−p2p_1 - p_2, and the procedure is a two-sample z test for p1−p2p_1 - p_2. Name it in full on the exam. "A z test" alone is incomplete.

The two groups can come from two independent random samples (teens in 2016 and teens in 2026) or from random assignment in an experiment (households given new or old recycling bins). Two measurements on the same people, like before and after on the same players, are linked, so this test does not fit.

Hypotheses

The null hypothesis is "no difference": H0:p1−p2=0H_0: p_1 - p_2 = 0, which is the same as p1=p2p_1 = p_2. The alternative matches the question:

The question asks whetherAlternative
group 1's proportion is higherHa:p1−p2>0H_a: p_1 - p_2 > 0
group 1's proportion is lowerHa:p1−p2<0H_a: p_1 - p_2 < 0
the proportions differ, or "have changed"Ha:p1−p2≠0H_a: p_1 - p_2 \ne 0

Three rules. Hypotheses are about parameters (pp), never statistics (p^\hat{p}). Define each parameter in context right after them. And choose the direction from the question, before looking at the data; picking >> because the sample came out higher makes the evidence look stronger than it is.

Why the test pools the samples

Bar chart of the share of households that sorted recycling correctly: new bin 0.781 (125 of 160), old bin 0.650 (91 of 140), and the pooled proportion 0.72 (216 of 300), shown as a dashed line that lies between the two.
Figure 1. The pooled proportion sits between the two sample proportions, closer to the larger group. LevlPrep original diagram.

A significance test asks: if H0H_0 were true, how surprising would our data be? So every calculation is done as if H0H_0 were true. If p1=p2p_1 = p_2, both samples come from populations with the same proportion, and the best estimate of that common value uses all the data at once. That is the pooled proportion:

pc=x1+x2n1+n2=total successestotal sample size.p_c = \frac{x_1 + x_2}{n_1 + n_2} = \frac{\text{total successes}}{\text{total sample size}}.

Pool the counts, not the proportions. Averaging p^1\hat{p}_1 and p^2\hat{p}_2 gives the wrong value whenever the sample sizes differ, because it lets the smaller sample count as much as the larger one. A confidence interval does not pool, because it makes no assumption that the proportions are equal.

Conditions

  • Random: two independent random samples, or two groups formed by random assignment.
  • 10%: when sampling without replacement, each sample is less than 10% of its population.
  • Large counts: because the test assumes H0H_0, use pcp_c: n1pcn_1 p_c, n1(1−pc)n_1(1 - p_c), n2pcn_2 p_c and n2(1−pc)n_2(1 - p_c) are each at least 10.

Worked example. A city randomly assigns 160 volunteer households a new recycling bin and 140 the old bin. Afterward, 125 of the new bin households and 91 of the old bin households sort correctly. Set up a test of whether the new bin increases correct sorting.

Procedure: a two-sample z test for pN−pOp_N - p_O.

Hypotheses: H0:pN−pO=0H_0: p_N - p_O = 0 and Ha:pN−pO>0H_a: p_N - p_O > 0, where pNp_N is the true proportion of households like these that would sort correctly with the new bin and pOp_O is the true proportion that would with the old bin.

Pooled proportion: pcp_c=125+91160+140= \frac{125 + 91}{160 + 140}=216300= \frac{216}{300}=0.72= 0.72.

Conditions. Random: the bins were randomly assigned to the households. 10%: not needed, because the households were not sampled from a larger population; they were volunteers, so any conclusion applies to households like them. Large counts: 160(0.72)=115.2160(0.72) = 115.2, 160(0.28)=44.8160(0.28) = 44.8, 140(0.72)=100.8140(0.72) = 100.8 and 140(0.28)=39.2140(0.28) = 39.2 are each at least 10.

The figure shows the three proportions from this example. The pooled value, 0.72, is the single proportion both groups would share if the bin made no difference. The next topic uses it to build the test statistic and the p-value.

Spot a mistake on this page?