Tutorials › AP Statistics › Margin of Error for a Difference in Proportions

Two-proportion confidence intervals · Tutorial 515 of 1000

Margin of Error for a Difference in Proportions

See how the two groups’ estimated uncertainty combines into a margin of error for their difference, and compare it with a single-proportion margin.

Intermediate 10 min read

What You'll Learn

  • Calculate the margin of error for a two-proportion confidence interval.
  • Explain how each group’s sample proportion and sample size contribute to that margin.
  • Relate a difference margin to the two single-proportion margins.
  • Recognize why the difference margin is not the sum or difference of the individual margins.
  • Interpret a margin of error in the context of a population-proportion difference.

What the Margin of Error Measures

In Confidence Intervals for Differences in Observational Studies, the two-proportion interval was written as a sample difference plus or minus a margin of error. The point estimate, \(\hat{p}_1-\hat{p}_2\), is the center of the interval. The margin of error describes how far each endpoint is from that center, in proportion units. It measures the estimated sampling uncertainty in the difference—not the size of the observed difference itself.

For a two-proportion confidence interval, the margin of error depends on the confidence level and on the estimated standard error of \(\hat{p}_1-\hat{p}_2\). As explained in Standard Error for a Difference in Proportions, that standard error combines an estimated variance contribution from each independent group. The contributions add before taking the square root.

Formula: For a confidence level with critical value \(z^*\), the margin of error for a difference in proportions is:
$$ ME=z^*\sqrt{\frac{\hat{p}_1(1-\hat{p}_1)}{n_1} +\frac{\hat{p}_2(1-\hat{p}_2)}{n_2}} $$
Here, \(\hat{p}_1=x_1/n_1\) and \(\hat{p}_2=x_2/n_2\). The confidence interval is \((\hat{p}_1-\hat{p}_2)\mathbin{\pm}ME\). The margin of error is nonnegative; it is added to and subtracted from the point estimate.

The formula has two group-specific contributions inside the square root. A group’s contribution is larger when its sample proportion is closer to 0.5, or when its sample size is smaller, all else being equal. The critical value \(z^*\) also matters: it is selected for the desired confidence level. The next tutorial examines more fully how sample size and confidence level affect an interval.

Comparing With a Single-Proportion Margin

For one population proportion, the usual \(z\)-interval has margin of error \(z^*\sqrt{\hat{p}(1-\hat{p})/n}\). For a difference, each group has a corresponding single-proportion contribution, but the contributions combine through the square root of their squared standard errors. They do not simply get added as margins, and one margin is not subtracted from the other.

Key relationship: If each group’s single-proportion margin is calculated using the same confidence level, so both use the same \(z^*\), then:
$$ ME_{\text{difference}}=\sqrt{ME_1^2+ME_2^2} $$
This relationship follows because each individual margin is \(z^*\) times its group’s standard error. Squaring the margins, adding, and taking the square root gives \(z^*\) times the standard error for the difference.

Because both contributions are nonnegative, the difference margin is larger than either individual margin when both contributions are positive. It is generally smaller than their sum. For equal sample sizes and equal sample proportions, the two contributions are identical, so the difference margin is \(\sqrt{2}\) times either single-proportion margin—not twice that margin.

This is a comparison of margins, not a way to subtract two separate confidence intervals. To estimate \(p_1-p_2\), use the two-proportion interval formula and its combined standard error, keeping the group order consistent.

Worked Examples

Worked Example: Equal Single-Proportion Margins

Setting: Imagine two independent random samples of 100 households each, drawn from separate, large neighborhoods. In each sample, 40 households report having a home compost bin. Construct a 95% confidence interval for the difference in the population proportions, Neighborhood 1 minus Neighborhood 2. Compare its margin of error with the margin for either single proportion.

State: Let \(p_1\) and \(p_2\) be the true proportions of households with a compost bin in Neighborhood 1 and Neighborhood 2, respectively. The parameter is \(p_1-p_2\).

Plan: The two samples were independently and randomly selected, and each household contributes one response to one group. Suppose each neighborhood contains at least 1,000 households. The 10% condition holds for both samples because \(100\leq0.10(1000)=100\). For Large Counts, each group has 40 successes and \(100-40=60\) failures; all four counts are at least 10.

Do: Both sample proportions are \(40/100=0.40\), so the point estimate is \(0.40-0.40=0\). The estimated standard error for the difference is:

$$ SE_{\hat{p}_1-\hat{p}_2} =\sqrt{\frac{0.40(0.60)}{100}+\frac{0.40(0.60)}{100}} =\sqrt{0.0024+0.0024} =\sqrt{0.0048} \approx0.069282 $$

For 95% confidence, \(z^*\approx1.959964\). Thus the difference margin of error is:

$$ ME=1.959964(0.069282)\approx0.13579 $$

For either single proportion, the standard error is \(\sqrt{0.40(0.60)/100}\approx0.048990\), so its 95% margin of error is \(1.959964(0.048990)\approx0.09602\). The comparison also checks through the relationship between margins: \(\sqrt{0.09602^2+0.09602^2}\approx0.13579\), or \(\sqrt{2}(0.09602)\approx0.13579\). The interval for the difference is:

$$ 0\mathbin{\pm}0.13579 \quad\Longrightarrow\quad (-0.13579,\ 0.13579) $$

Conclude: The difference margin is about 0.136, or 13.6 percentage points. It is larger than either single-proportion margin of about 0.096, but it is not twice as large. The interval gives plausible values for the difference in the two population proportions; the margin describes the distance from its center, zero, to either endpoint.

Worked Example: Different Sample Sizes and Proportions

Setting: Imagine researchers independently select random samples of growers in two regions and ask whether each used a specified soil-testing service last season. In Region 1, 120 of 200 growers used it. In Region 2, 60 of 150 growers used it. Each region has at least 10 times its sample size in growers. Find the 90% confidence interval margin of error for Region 1 minus Region 2, and compare it with the two single-proportion margins.

State: Let \(p_1\) and \(p_2\) be the true proportions of growers who used the service in Regions 1 and 2. The parameter is \(p_1-p_2\).

Plan: The groups are separate, with one response per grower, and the samples are independent random samples. The 10% condition holds for each sample under the stated population sizes. For Large Counts, Region 1 has 120 successes and \(200-120=80\) failures; Region 2 has 60 successes and \(150-60=90\) failures. Each count is at least 10.

Do: The sample proportions are \(\hat{p}_1=120/200=0.60\) and \(\hat{p}_2=60/150=0.40\). The estimated standard error for the difference is:

$$ \begin{aligned} SE_{\hat{p}_1-\hat{p}_2} &=\sqrt{\frac{0.60(0.40)}{200}+\frac{0.40(0.60)}{150}}\\ &=\sqrt{0.0012+0.0016}\\ &=\sqrt{0.0028}\approx0.052915 \end{aligned} $$

For 90% confidence, \(z^*\approx1.644854\), so:

$$ ME=1.644854(0.052915)\approx0.08704 $$

The single-proportion margin for Region 1 is \(1.644854\sqrt{0.60(0.40)/200}=1.644854\sqrt{0.0012}\approx0.05698\). For Region 2 it is \(1.644854\sqrt{0.40(0.60)/150}=1.644854\sqrt{0.0016}\approx0.06579\). Combining those margins gives \(\sqrt{0.05698^2+0.06579^2}\approx0.08704\), matching the direct calculation. The point estimate is \(0.60-0.40=0.20\), so the interval is:

$$ 0.20\mathbin{\pm}0.08704 \quad\Longrightarrow\quad (0.11296,\ 0.28704) $$

Conclude: The margin of error for the difference is about 0.087, or 8.7 percentage points. It combines the uncertainty contributed by both regions; it is neither the sum \(0.05698+0.06579\) nor the difference between those margins. The interval estimates Region 1’s true proportion minus Region 2’s true proportion.

Worked Example: One Group Contributes More

Setting: Imagine independent random samples of users of two fictional navigation apps. The outcome is whether a user reports that the app’s route estimate was accurate on the most recent trip. In App A’s sample, 20 of 100 users report an accurate estimate. In App B’s sample, 200 of 400 do. Each app’s target population has at least 10 times its sample size. Find the 95% margin of error for App A minus App B and compare the group contributions.

State: Let \(p_A\) and \(p_B\) be the true proportions of users of Apps A and B, respectively, who report an accurate estimate. The parameter is \(p_A-p_B\).

Plan: Treat the samples as independent random samples, with one response per user. The 10% condition holds for both samples by the stated population sizes. For Large Counts, App A has 20 successes and \(100-20=80\) failures; App B has 200 successes and \(400-200=200\) failures. All four counts are at least 10.

Do: The sample proportions are \(\hat{p}_A=20/100=0.20\) and \(\hat{p}_B=200/400=0.50\). The standard error and 95% margin are:

$$ \begin{aligned} SE_{\hat{p}_A-\hat{p}_B} &=\sqrt{\frac{0.20(0.80)}{100}+\frac{0.50(0.50)}{400}}\\ &=\sqrt{0.0016+0.000625}\\ &=\sqrt{0.002225}\approx0.047170 \end{aligned} $$
$$ ME=1.959964(0.047170)\approx0.09245 $$

App A’s individual margin is \(1.959964\sqrt{0.0016}=1.959964(0.04)\approx0.07840\). App B’s is \(1.959964\sqrt{0.000625}=1.959964(0.025)\approx0.04900\). The combined margin checks as \(\sqrt{0.07840^2+0.04900^2}\approx0.09245\). The point estimate is \(0.20-0.50=-0.30\), and the interval is approximately \((-0.39245,-0.20755)\).

Conclude: App A’s margin contribution is larger because its sample is smaller and its estimated proportion is farther from 0.5 than App B’s. The difference margin, about 0.09245 or 9.25 percentage points, combines both contributions. It is not equal to the larger individual margin or to the sum of the two margins.

Common Mistakes and AP Exam Tips

  • Confusing the margin with the observed difference: The point estimate is \(\hat{p}_1-\hat{p}_2\); the margin of error is \(z^*\) times the estimated standard error. They play different roles in the interval.
  • Adding or subtracting the individual margins: With the same confidence level, combine the individual margins as \(\sqrt{ME_1^2+ME_2^2}\). This matches the two-proportion standard error formula for independent groups.
  • Dropping a group’s contribution: Both estimated variance terms belong under the square root. A large sample in one group does not make the other group’s uncertainty disappear.
  • Using a test standard error: For a confidence interval, use each group’s sample proportion in its own term. As in earlier two-proportion interval tutorials, do not pool the proportions.
  • Reporting the margin without units or context: A margin such as 0.09245 is a proportion, equivalent to 9.245 percentage points. It is not a percent increase or a statement about the relative size of the groups.
AP Exam Tip: Show the two group-specific terms inside the square root, multiply their combined standard error by the correct \(z^*\), and state the margin as the distance from the interval’s center to either endpoint. If you compare it with single-proportion margins, make sure they use the same confidence level.

Key Takeaway

The margin of error for a difference in proportions reflects uncertainty from both independent samples. Each group contributes according to its sample proportion and sample size, and the two contributions combine through the square root of the sum of their variances.

Key takeaway: Calculate \(ME=z^*\sqrt{\hat{p}_1(1-\hat{p}_1)/n_1+\hat{p}_2(1-\hat{p}_2)/n_2}\). At the same confidence level, the difference margin equals the square root of the sum of the squared single-proportion margins—not their sum or their difference.

Check Your Understanding

Use the relationship between the two-proportion margin and its group-specific contributions to answer these questions.

  1. If two groups have identical sample proportions and sample sizes, how does the margin of error for their difference compare with either single-proportion margin?
  2. For the same confidence level, two individual margins are 0.04 and 0.03. What is the margin of error for their difference, rounded to four decimal places?
  3. Why does a larger sample size, with the sample proportion held fixed, reduce that group’s contribution to the difference margin?
  4. A student adds the two single-proportion margins to get the margin for a difference. What relationship should the student use instead?
  5. In a two-proportion interval, what does the margin of error describe, and how is it different from the point estimate?