01 / 21
\(\hat{p}_1\)
\(\hat{p}_2\)

Difference of Two
Population Proportions

Learn how to set up a hypothesis test comparing proportions from two independent populations: identifying parameters, writing hypotheses, and checking conditions.

AP Statistics

Why Compare Two Proportions?

In many real-world studies, we want to know whether a categorical outcome occurs at different rates in two groups. For example:

Medicine
Does a new drug produce a higher cure rate than a placebo?
Education
Do students taught with method A pass at a higher rate than those taught with method B?
Marketing
Does ad layout 1 produce more clicks than ad layout 2?

Key Terminology

1
\( p_1 \) and \( p_2 \): The true population proportions for Group 1 and Group 2 (parameters: unknown).
2
\( \hat{p}_1 \) and \( \hat{p}_2 \): The sample proportions from each group (statistics: observed).
3
\( n_1 \) and \( n_2 \): The sample sizes for Group 1 and Group 2.
4
\( \hat{p}_c \) (pooled proportion): The combined success rate across both samples, used under \( H_0 \).

Parameters vs. Statistics

Population 1
True proportion: \(p_1\)
Population 2
True proportion: \(p_2\)
sample sample
\(n_1\) observations
Statistic: \(\hat{p}_1\)
\(n_2\) observations
Statistic: \(\hat{p}_2\)
We test: \(p_1 - p_2\)

The Hypothesis Framework

Every two-proportion z-test begins by stating a null hypothesis and an alternative hypothesis about the parameter \( p_1 - p_2 \).

Null Hypothesis \( H_0 \)
\( p_1 - p_2 = 0 \)
There is no difference between the two population proportions.
Alternative \( H_a \)
\( p_1 - p_2 \neq 0 \), or \( > 0 \), or \( < 0 \)
There is a difference (direction depends on the research question).

Three Forms of \( H_a \)

Type \( H_a \) Tail Key Phrase
Two-sided \( p_1 - p_2 \neq 0 \) Two-tailed "is different from"
Left-sided \( p_1 - p_2 < 0 \) Left-tailed "is less than"
Right-sided \( p_1 - p_2 > 0 \) Right-tailed "is greater than"

Conditions for Inference

Before computing a test statistic, you must verify three conditions to ensure the sampling distribution is approximately Normal:

1
Random: Both samples are collected using a random process (random sampling or random assignment).
2
Independent (10% Rule): Each sample is less than 10% of its respective population: \( n_1 \leq 0.10 N_1 \) and \( n_2 \leq 0.10 N_2 \). In experiments with random assignment, this condition is met by design.
3
Large Counts (using \( \hat{p}_c \)): \( n_1 \hat{p}_c \geq 10 \), \( n_1(1-\hat{p}_c) \geq 10 \), \( n_2 \hat{p}_c \geq 10 \), and \( n_2(1-\hat{p}_c) \geq 10 \).

The Pooled Proportion \( \hat{p}_c \)

$$\hat{p}_c = \frac{x_1 + x_2}{n_1 + n_2}$$

Where \( x_1 \) and \( x_2 \) are the number of successes in each sample. This pooled value replaces both \( \hat{p}_1 \) and \( \hat{p}_2 \) when checking the Large Counts condition and computing the test statistic.

One-Proportion vs. Two-Proportion Test

Feature One-Proportion z-Test Two-Proportion z-Test
Parameter \( p \) \( p_1 - p_2 \)
\( H_0 \) \( p = p_0 \) \( p_1 - p_2 = 0 \)
Large Counts uses \( p_0 \) (claimed value) \( \hat{p}_c \) (pooled from data)
SE denominator uses \( p_0 \) \( \hat{p}_c \)
Samples needed 1 2 independent

How to Set Up the Test

1
Define parameters: Let \( p_1 \) = true proportion of [outcome] in [Group 1] and \( p_2 \) = true proportion in [Group 2].
2
State hypotheses: \( H_0\!: p_1 - p_2 = 0 \) and choose \( H_a \) based on the research question (\( \neq \), \( < \), or \( > \)).
3
Check Random: Were both samples selected randomly, or was random assignment used?
4
Check Independent (10% Rule): \( n_1 \leq 0.10 N_1 \) and \( n_2 \leq 0.10 N_2 \). For experiments, independence follows from random assignment.
5
Compute \( \hat{p}_c \) and check Large Counts: All four values \( n_1 \hat{p}_c \), \( n_1(1 - \hat{p}_c) \), \( n_2 \hat{p}_c \), \( n_2(1 - \hat{p}_c) \geq 10 \).

Example 1: Vaccine Trial

A pharmaceutical company tests whether a new vaccine reduces infection rates. In a randomized experiment, 500 subjects receive the vaccine and 500 receive a placebo. Results: 30 of 500 vaccinated subjects got infected, and 55 of 500 placebo subjects got infected.

Example 1: Checking Conditions

✓
Random: Subjects were randomly assigned to vaccine or placebo groups.
✓
Independent: Random assignment ensures the groups are independent. (10% rule is not needed for experiments.)
✓
Large Counts: First compute \( \hat{p}_c = \frac{30 + 55}{500 + 500} = \frac{85}{1000} = 0.085 \).
\( 500(0.085) = 42.5 \geq 10 \) ✓
\( 500(0.915) = 457.5 \geq 10 \) ✓
(Same for both groups since \( n_1 = n_2 \).)

Example 2: Voter Survey

A pollster randomly surveys 400 voters in City A and 350 voters in City B to see if the proportion supporting a ballot measure differs. In City A, 212 of 400 support it. In City B, 161 of 350 support it.

Example 3: Condition Failure

A teacher surveys 15 students from School X and 18 students from School Y to compare the proportion who own a laptop. School X: 3 of 15 own one. School Y: 5 of 18.

Common Mistakes

✕ Wrong Large Counts value
Using \( \hat{p}_1 \) and \( \hat{p}_2 \) separately instead of the pooled \( \hat{p}_c \) when checking large counts for a hypothesis test.
✕ Defining parameters as statistics
Writing "Let \( \hat{p}_1 \) = proportion who..." instead of defining \( p_1 \) as the population parameter. Always define the unknown parameter.
✕ Wrong direction of \( H_a \)
Choosing \( p_1 - p_2 > 0 \) when the problem says Group 1 has a lower rate. Match the inequality to the claim.

Setup Checklist Summary

Step What to Write Watch Out For
1. Parameters Define \( p_1 \) and \( p_2 \) in context Use population proportions, not \( \hat{p} \)
2. Hypotheses \( H_0\!: p_1 - p_2 = 0 \); choose \( H_a \) Direction must match claim
3. Random State the random mechanism Convenience samples fail
4. Independent 10% rule or random assignment Experiments: cite random assignment
5. Large Counts Compute \( \hat{p}_c \); show all 4 products \( \geq 10 \) Use \( \hat{p}_c \), not \( \hat{p}_1 \) or \( \hat{p}_2 \)

Question 1 of 5

A researcher wants to test whether the proportion of smokers in City A is different from the proportion in City B. Which hypotheses should the researcher use?

Question 2 of 5

In a two-proportion z-test, the Large Counts condition requires all four products to be at least 10. Which value should be used to compute these products?

Question 3 of 5

A study randomly assigns 200 patients to Drug A and 200 to Drug B. Which condition is automatically satisfied by the study design?

Question 4 of 5

A random sample of 60 students from School A shows 18 prefer online learning. A random sample of 80 from School B shows 32 prefer it. What is the pooled proportion \( \hat{p}_c \)?

Question 5 of 5

A company claims its new website design has a higher click-through rate than the old design. Let \( p_1 \) = new design proportion and \( p_2 \) = old design proportion. What is the correct \( H_a \)?