AP® Statistics review sheet from Aim for Five (aimforfive.com/stats/units/3/3-12)
Unit 3 · Topic 3.12
3.12 Setting Up a Test for the Difference Between Two Population Proportions
A two-sample z-test checks whether two population proportions differ. Set it up with H₀: p₁ = p₂, choose a one- or two-sided alternative and check conditions using the combined (pooled) proportion p̂c, since the test assumes the two proportions are equal.
Key terms
- two-sample z-test
- H₀: p₁ = p₂
- combined (pooled) proportion p̂c
- conditions for a test
Hypotheses
H₀: p₁ = p₂ (equivalently p₁ − p₂ = 0). Hₐ is one of p₁ > p₂, p₁ < p₂ or p₁ ≠ p₂ (equivalently p₁ − p₂ > 0, < 0 or ≠ 0).
Define both parameters in context, as in 3.10. The direction of Hₐ comes from the research question.
The combined proportion
If H₀ is true, both groups share one common proportion. Your best estimate of it combines the two samples: p̂c = (total successes) ÷ (total sample size) = (n₁p̂₁ + n₂p̂₂)/(n₁ + n₂) = (x₁ + x₂)/(n₁ + n₂). This is on the formula sheet.
In the flu-shot study, p̂c = (145 + 120)/(250 + 250) = 265/500 = 0.53.
Why pool?
The test's standard error is computed under the assumption that H₀ is true. If p₁ = p₂, both samples estimate the same proportion, and combining them gives a better estimate of it than either sample alone. That's why the test uses p̂c, while the interval, which doesn't assume equal proportions, uses p̂₁ and p̂₂ separately.
In an experiment, H₀ says the treatment has no effect: each subject would have had the same response whichever group they landed in.
Conditions
The normal check below uses p̂c, because the test assumes H₀ is true; that's how the course describes it. Many teachers and textbooks also accept checking the observed successes and failures in each group.
- Random: two independent random samples or a randomized experiment.
- 10%: each sample is at most 10% of its population when sampling without replacement (not needed for an experiment).
- Normal: n₁p̂c, n₁(1 − p̂c), n₂p̂c and n₂(1 − p̂c) are all at least 10.
Choosing the right procedure
Use a two-sample z-test for proportions when the response is categorical with two outcomes (success or failure) and there are two independent groups. If there are more than two groups or more than two response categories, use a chi-square test (3.14). If the response is quantitative, use a t procedure (Unit 4).
Procedures so far
| Situation | Procedure |
|---|---|
| One proportion, estimate it | One-sample z-interval for p |
| One proportion, test a claim | One-sample z-test for p |
| Two groups, estimate the difference | Two-sample z-interval for p₁ − p₂ |
| Two groups, test for a difference | Two-sample z-test for p₁ − p₂ |
| More than two groups or categories | Chi-square test |
Worked examples
Try each one yourself first, then open the solution.
- Example 1Calculator allowed
Set up a two-sample test
In the flu-shot experiment, 250 patients were randomly assigned to get a text reminder and 250 to get none; 145 and 120 got the shot. Set up a test of whether reminders increase the vaccination rate.
Show the solutionHide the solution
- Step 1: Test: two-sample z-test for a difference in proportions.
- Step 2: p₁ = true proportion of patients like these who would get a flu shot with a reminder; p₂ = the same without a reminder.
- Step 3: H₀: p₁ − p₂ = 0. Hₐ: p₁ − p₂ > 0.
- Step 4: Random: treatments were randomly assigned. 10%: not needed for an experiment.
- Step 5: p̂c = 265/500 = 0.53. n₁p̂c = 250(0.53) = 132.5, n₁(1 − p̂c) = 117.5, and the same for group 2 (n₂ = 250). All are at least 10.
Answer: Two-sample z-test with H₀: p₁ − p₂ = 0 vs. Hₐ: p₁ − p₂ > 0. Conditions are met (random assignment; pooled expected counts 132.5 and 117.5 in each group).
- Example 2Calculator allowed
Trap: one population, two questions
A random sample of 300 teens is asked whether they use App A and whether they use App B. 61% use A and 52% use B. A student runs a two-sample z-test to compare. What's wrong?
Show the solutionHide the solution
- Step 1: The two proportions come from the same 300 teens, so the samples aren't independent.
- Step 2: The two-sample z-test needs two independent groups.
- Step 3: The standard error formula would be wrong here, so this test isn't appropriate.
Answer: The data aren't from two independent samples; the same teens answered both questions, so a two-sample z-test isn't appropriate.
Common mistakes
- Writing H₀ with sample proportions (p̂₁ = p̂₂).
- Using a two-sample test when the same individuals give both responses.
- Forgetting to define which group is 1 and which is 2.
- Computing p̂c as the average of p̂₁ and p̂₂ when the sample sizes differ. Add the successes, then divide by the total n.
On the exam
- The test name, hypotheses with defined parameters and condition checks are each scored. Write them out even if they feel obvious.
- Watch the wording: "different" means two-sided; "higher" or "lower" means one-sided.
Connected topics
Videos
Check yourself
3 questions on 3.12 Setting Up a Test for the Difference Between Two Population Proportions. Pick an answer to see if you got it, and why.
A researcher wants to know whether the proportion of adults who get a flu shot differs between City A and City B. Which hypotheses are correct?
Independent random samples give 18 successes out of 60 in group 1 and 30 successes out of 90 in group 2. For a test of H₀: p₁ = p₂, the combined proportion is p̂c = 48/150 = 0.32. Which check of the large counts condition is correct?
A clinic randomly assigned 490 patients with upcoming appointments to two groups. The 250 patients in one group got a text reminder the day before, and 185 of them showed up. The 240 patients in the other group got no reminder, and 156 of them showed up.
Described experiment with invented results
For a test of H₀: p_text = p_none, what is the combined (pooled) proportion p̂c?
0 of 3 answered