Setting Up a Test for a Difference in Proportions
How to write hypotheses about p₁ − p₂, name the two-sample z-test, and check its conditions, including the pooled proportion that the normality condition uses because H₀ says the proportions are equal.
To test whether two groups differ on a yes or no outcome, assume they do not: \(H_0: p_1 = p_2\). Under that assumption the two groups share one proportion, so the normality condition uses the pooled (combined) proportion of successes. The procedure is the two-sample z-test for the difference between two population proportions.
1Parameters and procedure
The parameters are the two population proportions; the hypotheses are about their difference. Define each one in context, naming the response variable and the population, and keep the order fixed.
Reminder texts
A school randomly assigns 240 students who missed an assignment to receive a reminder text (120) or no text (120). The question: does a reminder text increase the proportion who turn in the work within two days? State the hypotheses and name the procedure.
- 1Parameters: \(p_1\) = the true proportion of students like these who turn in the work within two days when they get a text; \(p_2\) = the same proportion when they get no text.
- 2\(H_0: p_1 - p_2 = 0\) (no difference). \(H_a: p_1 - p_2 \gt 0\) (texts increase the proportion).
- 3Procedure: two-sample z-test for the difference between two population proportions.
2Hypotheses
The null hypothesis says there is no difference: \(H_0: p_1 = p_2\), or equivalently \(H_0: p_1 - p_2 = 0\). The alternative can be one-sided (\(p_1 \gt p_2\) or \(p_1 \lt p_2\)) or two-sided (\(p_1 \ne p_2\)), chosen from the question before the data are seen.
\(H_0: \hat{p}_1 = \hat{p}_2\) makes no sense: the sample proportions, 0.70 and 0.55, are known and plainly not equal. The hypotheses are about the population proportions \(p_1\) and \(p_2\).
Walking to school
Independent random samples from two large schools found 33 of 150 students at School 1 and 21 of 160 at School 2 walk to school. Is there a difference in the proportions? Set up the test and check the conditions.
- 1\(p_1\), \(p_2\) = the proportions of all students at School 1 and School 2 who walk to school. \(H_0: p_1 = p_2\), \(H_a: p_1 \ne p_2\).
- 2Randomization: independent random samples. 10% condition: 150 and 160 are each no more than 10% of their large schools.
- 3Pooled proportion: \(\hat{p}_c = 54/310 \approx 0.174\). Expected counts: \(150(0.174) \approx 26.1\), \(150(0.826) \approx 123.9\), \(160(0.174) \approx 27.9\), \(160(0.826) \approx 132.1\): all at least 10.
3Conditions and the pooled proportion
| Condition | Check |
|---|---|
| Randomization | Two independent random samples, or a randomized experiment |
| 10% condition | \(n_1 \le 0.10N_1\) and \(n_2 \le 0.10N_2\) when sampling without replacement (not needed for an experiment) |
| Normality | \(n_1\hat{p}_c\), \(n_1(1-\hat{p}_c)\), \(n_2\hat{p}_c\), \(n_2(1-\hat{p}_c)\) all at least 10 |
Here \(\hat{p}_c\) is the combined, or pooled, proportion assuming H₀ is true:
Reminder texts
84 of the 120 texted students and 66 of the 120 others turned in their work. Check the conditions for the test.
- 1Randomization: the treatments were randomly assigned. This is an experiment, so the 10% condition does not apply.
- 2Pooled proportion: \(\hat{p}_c = \dfrac{84 + 66}{120 + 120} = 0.625\).
- 3Normality: \(n_1\hat{p}_c = 75\), \(n_1(1 - \hat{p}_c) = 45\), \(n_2\hat{p}_c = 75\), \(n_2(1 - \hat{p}_c) = 45\), all at least 10.
A small pilot
In a small pilot, 3 of 25 students using a new study app and 1 of 25 using the old one raised their grade by a full letter. Can the two-sample z-test be used?
- 1\(\hat{p}_c = (3 + 1)/(25 + 25) = 0.08\).
- 2\(n_1\hat{p}_c = 25(0.08) = 2\), less than 10.
A confidence interval checks normality with each sample’s own counts, because it assumes nothing about the proportions. A test assumes H₀, under which the proportions are equal, so it uses the pooled proportion. Keep track of which procedure you are doing.
In a randomized experiment the subjects are not a sample drawn from a larger population, so there is nothing to compare 10% against. The randomization condition is met by the random assignment of treatments.
“Normality: the pooled proportion is p̂c = 150/240 = 0.625. Assuming H₀ is true, the expected numbers of successes and failures in each group are 120(0.625) = 75 and 120(0.375) = 45, all at least 10.”
4Quick reference
| Step | What to write |
|---|---|
| Parameters | \(p_1\), \(p_2\) in context; the order of subtraction |
| Hypotheses | \(H_0: p_1 - p_2 = 0\); \(H_a: p_1 - p_2 \gt 0\), \(\lt 0\), or \(\ne 0\) |
| Procedure | Two-sample z-test for the difference between two population proportions |
| Pooled proportion | \(\hat{p}_c\) = total successes ÷ total sample size |
| Conditions | Random samples or random assignment; 10% (samples only); four pooled expected counts ≥ 10 |