Unit 3 · Topic 3.13 · about 25 minutes

Carrying Out a Test for the Difference Between Two Population Proportions

Finish a two-sample z-test from the test statistic to a conclusion in context, and say exactly what its p-value means.

Predict first

Two gardeners test whether soaking seeds overnight changes the proportion that sprout. Gardener A plants 30 soaked and 30 unsoaked seeds: 18 soaked and 12 unsoaked seeds sprout (60% versus 40%). Gardener B plants 1,000 of each: 540 soaked and 480 unsoaked seeds sprout (54% versus 48%). Whose results give more convincing evidence that soaking changes the sprouting rate?

The test statistic

Every z and t test statistic in this course has the same shape:

statistic−value under H0standard error of the statistic

For two proportions the statistic is p^1−p^2, the value under H0 is a difference of 0, and the standard error uses the pooled proportion p^c from topic 3.12:

z=(p^1−p^2)−0p^c(1−p^c)(1n1+1n2),p^c=n1p^1+n2p^2n1+n2

The pooled standard error is there because the whole calculation runs under the assumption that H0 is true, and under H0 both groups share one proportion. When H0 is true, this z-statistic has a standard normal distribution. So the p-value is an area under the standard normal curve, found with a table or technology, and the alternative hypothesis decides which area.

Which area is the p-value?
Alternative hypothesisp-value
Ha:p1>p2Area to the right of z
Ha:p1<p2Area to the left of z
Ha:p1≠p2Area beyond z in both tails, which is twice the area beyond |z|

Worked exampleDoes a picture label cut recycling contamination?

A city randomly assigns 600 households to two groups of 300. One group gets recycling bins with a new picture label showing what belongs inside; the other keeps the old text-only label. A month later, inspectors find contaminated recycling (trash mixed in) at 54 of the new-label households and 78 of the old-label households. Do the data provide convincing statistical evidence, at the α=0.05 level, that the new label reduces the proportion of households with contaminated recycling?

  1. Name the test and state hypotheses. Two-sample z-test for pN−pO, where pN and pO are the proportions of households like these that would have contaminated recycling with the new label and with the old label. H0:pN=pO and Ha:pN<pO.

  2. Check conditions. Randomization: the labels were randomly assigned to households. The 10% condition is not needed for a randomized experiment. Normality: p^c=54+78600=0.22, and each group has 300(0.22)=66 and 300(0.78)=234, all at least 10.

  3. Calculate. p^N=54300=0.18 and p^O=78300=0.26. SE=0.22(0.78)(1300+1300)≈0.0338, so z=0.18−0.260.0338≈−2.37. Because Ha says less than, the p-value is the area to the left: P(Z≤−2.37)≈0.009.

  4. Conclude in context. The p-value of 0.009 is less than α=0.05, so reject H0. There is convincing statistical evidence that the proportion of households like these with contaminated recycling is lower with the new picture label than with the old label.

Answer.

z≈−2.37 and the p-value is about 0.009, so reject H0. Because the labels were randomly assigned, the evidence points to the new label as the reason for the lower contamination rate.

The p-value for z=−2.37

−3−2−10123Test statistic z

Standard normal curve. The shaded left tail, about 0.009, is the p-value for Ha:pN<pO.

What the p-value means

The p-value is the probability of getting a test statistic as extreme as the one observed, or more extreme in the direction of Ha, assuming H0 is true. An interpretation has to say that it was computed assuming H0, which for two proportions means assuming the two population proportions are equal, in context:

Assuming the new and old labels produce the same proportion of contaminated recycling, there is about a 0.009 probability of getting a difference in sample proportions of −0.08 or less (a z-statistic of −2.37 or less) by chance in the random assignment.

A result that rare would be surprising if the labels made no difference, which is why a small p-value counts as evidence for Ha. It is not the probability that H0 is true.

Making the decision

Compare the p-value with the significance level α, and say that you are comparing them:

  • If the p-value is less than or equal to α, reject H0. There is convincing statistical evidence for Ha.
  • If the p-value is greater than α, fail to reject H0. There is not convincing statistical evidence for Ha.

Then state the conclusion in context, in terms of Ha, about the populations or treatments, using language that stops short of certainty. That conclusion is the statistical answer to the question the study set out to investigate. The city wanted to know whether a picture label would cut contamination, and the test gives convincing evidence that it does.

A large p-value needs the most careful wording. Gardener A's p-value was about 0.12, so: because 0.12>0.05, fail to reject H0; the data do not provide convincing statistical evidence that soaking changes the proportion of seeds that sprout. That is not the same as saying soaking does nothing. With 30 seeds per group, her experiment could easily miss a real effect.

Check your understanding

1

A gym randomly assigns 240 new members to two groups of 120. One group gets a free personal-training session and the other does not. After three months, 104 of the members who had the session and 88 of those who did not are still active. Let pT be the proportion of new members like these who would still be active after three months with the training session, and pN the proportion without it. Find the test statistic z for H0:pT=pN against Ha:pT>pN. Round to two decimal places.

2

A company randomly assigns new hires to watch a new onboarding video or the old one, then tests H0:pV=pO against Ha:pV>pO, where each p is the proportion of new hires like these who would finish training in their first week. The p-value is 0.031. Which is a correct interpretation of the p-value?

3

A two-sample z-test of whether the proportion of adults who prefer paper books differs between two large cities, using a random sample from each city, gives a p-value of 0.12. At α=0.05, which conclusion is correct?

4

Random samples of morning-shift and evening-shift workers at a large factory are asked whether they have back pain. A test of H0:pM=pE against Ha:pM>pE, where pM and pE are the proportions of all morning-shift and all evening-shift workers at the factory with back pain, gives a p-value of 0.004. At α=0.01, which conclusion is correct?

5

A researcher tests H0:p1=p2 against Ha:p1<p2. Her samples give p^1−p^2=0.06 and a test statistic of z=1.20. What is the p-value?

Practice

Practice until it is automatic

New numbers every time. Each one is checked the moment you answer, with the full working shown.

Comparing two proportions practice page

Course alignment, for teachers

AP Statistics topic 3.13, Unit 3: Inference for Categorical Data: Proportions.

  • Skill 3.E: Calculate appropriate statistical inference method results.
  • Skill 4.F: Interpret results of statistical inference methods.
  • Skill 4.G: Justify a claim based on statistical inference method results.