A Confidence Interval for a Difference in Proportions
How to estimate the difference between two population proportions with a two-sample z-interval: defining the parameters, checking conditions for two samples or an experiment, and computing the standard error, margin of error and interval.
To compare two groups on a yes or no outcome, estimate the difference in their proportions, \(p_1 - p_2\). The point estimate is \(\hat{p}_1 - \hat{p}_2\); the interval adds and subtracts a margin of error built from both samples’ variability. The procedure is the two-sample z-interval for a difference between population proportions.
1The parameter
The parameter for this interval is a difference: \(p_1 - p_2\). Define it in context by naming the difference, the response variable, and both populations, and make the order of subtraction clear.
12th minus 10th
A classmate computes the sleep interval as 12th graders minus 10th graders. What does their interval look like, and does the meaning change?
- 1Swapping the order flips the sign of the difference: \(0.25 - 0.37 = -0.12\).
- 2The interval becomes \((-0.208,\ -0.032)\): the same width, mirrored around 0.
An interval of (0.032, 0.208) means nothing until the reader knows it is 10th graders minus 12th graders. Define \(p_1\) and \(p_2\) explicitly and keep the same order in the calculation and the conclusion.
2Conditions
| Condition | Check |
|---|---|
| Randomization | Two independent random samples, or a randomized experiment |
| 10% condition | When sampling without replacement, \(n_1 \le 0.10N_1\) and \(n_2 \le 0.10N_2\) (not needed for a randomized experiment) |
| Normality | Observed successes and failures in both samples, \(n_1\hat{p}_1\), \(n_1(1-\hat{p}_1)\), \(n_2\hat{p}_2\), \(n_2(1-\hat{p}_2)\), all at least 10 |
Each sample needs at least 10 successes and at least 10 failures. With 74 of 200 and 55 of 220, the four counts are 74, 126, 55 and 165. Check all four.
3The calculation
The point estimate is \(\hat{p}_1 - \hat{p}_2\). The interval is point estimate ± margin of error:
The square root is the standard error of the difference, \(SE_{\hat{p}_1 - \hat{p}_2}\). The margin of error is \(z^*\) times that standard error.
99% for the sleep data
Find the 99% interval for the sleep data and compare it with the 95% interval.
- 1z* rises from 1.96 to 2.576; the standard error stays 0.0449.
- 2\(ME = 2.576(0.0449) \approx 0.116\). Interval: \(0.12 \pm 0.116 = (0.004,\ 0.236)\).
4Start to finish
Sleep by grade
Independent random samples at a large high school found that 74 of 200 tenth graders and 55 of 220 twelfth graders usually get at least 8 hours of sleep on school nights. Construct a 95% confidence interval for the difference in the proportions.
- 1State. \(p_1 - p_2\), where \(p_1\) = the proportion of all 10th graders at the school who usually get at least 8 hours of sleep on school nights and \(p_2\) = the same proportion for all 12th graders. 95% confidence.
- 2Plan. Two-sample z-interval for a difference between population proportions. Randomization: independent random samples from each grade. 10% condition: 200 and 220 are each no more than 10% of their grade (each grade has well over 2,200 students). Normality: 74, 126, 55 and 165 successes and failures are all at least 10.
- 3Do. \(\hat{p}_1 = 0.37\), \(\hat{p}_2 = 0.25\), difference 0.12. \(SE = \sqrt{0.37(0.63)/200 + 0.25(0.75)/220} \approx 0.0449\). \(ME = 1.96(0.0449) \approx 0.088\). Interval: \(0.12 \pm 0.088 = (0.032,\ 0.208)\).
- 4Conclude. We are 95% confident that the interval from 0.032 to 0.208 captures the true difference in the proportions of 10th graders and 12th graders at the school who usually get at least 8 hours of sleep (10th minus 12th).
STAT, TESTS, 2-PropZInt. Enter x1 = 74, n1 = 200, x2 = 55, n2 = 220, C-Level 0.95. The output (0.03196, 0.20804) matches. The calculator always computes group 1 minus group 2, so enter the groups in the order you defined.
Reminder texts
A school randomly assigned 240 students who missed an assignment to get a reminder text (120) or no text (120). 84 of the texted students and 66 of the others turned the assignment in within two days. Find a 90% confidence interval for the difference in proportions (text minus no text).
- 1Randomization: the treatments were randomly assigned. Because this is an experiment, the 10% condition does not apply.
- 2Normality: 84, 36, 66 and 54 are all at least 10.
- 3\(\hat{p}_1 = 0.70\), \(\hat{p}_2 = 0.55\), difference 0.15. \(SE = \sqrt{0.70(0.30)/120 + 0.55(0.45)/120} \approx 0.0617\).
- 490%: \(z^* = 1.645\). Interval: \(0.15 \pm 1.645(0.0617) = (0.048,\ 0.252)\).
“We are 95% confident that the interval from 0.032 to 0.208 captures the true difference in the proportions of 10th graders and 12th graders at the school who usually get at least 8 hours of sleep (10th minus 12th).”
The samples’ difference is known exactly: 0.12. The interval is a statement about the populations: the true difference \(p_1 - p_2\) for all 10th and 12th graders at the school.
Quick reference
| Piece | Formula |
|---|---|
| Point estimate | \(\hat{p}_1 - \hat{p}_2\) |
| Standard error | \(\sqrt{\hat{p}_1(1-\hat{p}_1)/n_1 + \hat{p}_2(1-\hat{p}_2)/n_2}\) |
| Margin of error | \(z^* \times SE\) |
| Calculator | 2-PropZInt (group 1 − group 2) |