AP Statistics · Study guide

The interval is for p1 minus p2.

AP® Statistics · Unit 3 · Inference for Categorical Data: Proportions

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.

The idea in one paragraph

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.

Worked Example 1 Reverse the order

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?

  1. 1Swapping the order flips the sign of the difference: \(0.25 - 0.37 = -0.12\).
  2. 2The interval becomes \((-0.208,\ -0.032)\): the same width, mirrored around 0.
Answer: The meaning is the same: 12th graders’ proportion is lower by 0.032 to 0.208. Always state which group is subtracted from which.
Common Mistake 1 · Not saying which group comes first

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

ConditionCheck
RandomizationTwo independent random samples, or a randomized experiment
10% conditionWhen sampling without replacement, \(n_1 \le 0.10N_1\) and \(n_2 \le 0.10N_2\) (not needed for a randomized experiment)
NormalityObserved 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
Common Mistake 2 · Checking only two of the four counts

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:

\[ (\hat{p}_1 - \hat{p}_2) \pm z^* \sqrt{\frac{\hat{p}_1(1-\hat{p}_1)}{n_1} + \frac{\hat{p}_2(1-\hat{p}_2)}{n_2}} \]

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.

Figure 1. The standard error of a difference adds the two samples’ squared standard errors, then takes the square root, for the same reason variances add for a difference of independent statistics.
Worked Example 2 A higher confidence level

99% for the sleep data

Find the 99% interval for the sleep data and compare it with the 95% interval.

  1. 1z* rises from 1.96 to 2.576; the standard error stays 0.0449.
  2. 2\(ME = 2.576(0.0449) \approx 0.116\). Interval: \(0.12 \pm 0.116 = (0.004,\ 0.236)\).
Answer: (0.004, 0.236): wider than the 95% interval, and its lower end now sits just above 0.

4Start to finish

Worked Example 3 A complete 95% interval

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.

  1. 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.
  2. 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.
  3. 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)\).
  4. 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).
Answer: (0.032, 0.208). The proportion is about 3 to 21 percentage points higher for 10th graders.
Figure 2. The point estimate is the difference in sample proportions, 0.37 − 0.25 = 0.12. The 95% interval reaches one margin of error, 0.088, each way. Every value in it is positive.
On the calculator

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.

Worked Example 4 An interval from an experiment

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).

  1. 1Randomization: the treatments were randomly assigned. Because this is an experiment, the 10% condition does not apply.
  2. 2Normality: 84, 36, 66 and 54 are all at least 10.
  3. 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\).
  4. 490%: \(z^* = 1.645\). Interval: \(0.15 \pm 1.645(0.0617) = (0.048,\ 0.252)\).
Answer: (0.048, 0.252). We are 90% confident that a reminder text raises the proportion who turn in the work within two days by between about 5 and 25 percentage points, for students like these.
Say it like this

“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).”

Common Mistake 3 · Interpreting the interval as a difference in the samples

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

PieceFormula
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\)
Calculator2-PropZInt (group 1 − group 2)