Tutorials › VEE Mathematical Statistics › Wald Confidence Intervals For Two Proportions

VEE Mathematical Statistics · Intervals for Variances and Proportions · Tutorial 579 of 880

Wald Confidence Intervals For Two Proportions

Build and interpret Wald intervals for the difference between independent proportions using each sample’s own estimated proportion and sample size.

Intermediate 12 min read

What You'll Learn

  • Define the difference between two independent population proportions and its sample estimate.
  • Calculate the unpooled estimated standard error for a difference in proportions.
  • Check the success and failure counts needed for a normal approximation.
  • Construct two-sided Wald confidence intervals at common confidence levels.
  • Interpret the interval in the context and direction of the comparison.
  • Recognize denominator and standard-error errors that can distort an interval.

Why Estimate a Difference Between Proportions?

Many questions compare the prevalence of a yes-or-no outcome in two populations: for example, the proportion of policyholders who choose an optional feature under two hypothetical enrollment approaches. The target is not either proportion by itself, but the difference between them. A confidence interval expresses the uncertainty in that estimated difference while preserving which population is subtracted from which.

This tutorial develops the large-sample Wald confidence interval for the difference between two independent proportions. Its standard error is unpooled: it uses a separate estimated variance from each sample. The method relies on a normal approximation, so the sample sizes and observed counts must be adequate.

Definition: Suppose two independent random samples contain \(n_1\) and \(n_2\) observations. In sample \(j\), let \(X_j\) be the number with the outcome of interest and let \(\hat p_j=X_j/n_j\), for \(j=1,2\). The parameter of interest is \(p_1-p_2\), the difference between the two population proportions, and its estimate is \(\hat p_1-\hat p_2\). The ordering matters: this quantity is the first population’s proportion minus the second’s.

The Wald Interval for Two Independent Proportions

Assume each sample is random, observations within each sample are independent and have the same probability of the outcome, and the two samples are independent of one another. Each observation is classified as either having or not having the outcome. Under these conditions, \(X_j\) has a binomial distribution with sample size \(n_j\) and population proportion \(p_j\).

The estimated standard error uses the two sample proportions separately:

$$ \widehat{\operatorname{SE}}(\hat p_1-\hat p_2) = \sqrt{\frac{\hat p_1(1-\hat p_1)}{n_1} +\frac{\hat p_2(1-\hat p_2)}{n_2}}. $$

For a two-sided confidence level of \(100(1-\alpha)\%\), let \(z_{1-\alpha/2}\) be the standard normal quantile with cumulative probability \(1-\alpha/2\). The Wald interval is

$$ (\hat p_1-\hat p_2) \mathbin{\pm} z_{1-\alpha/2}\, \widehat{\operatorname{SE}}(\hat p_1-\hat p_2). $$

Common critical values are approximately 1.645 for 90%, 1.960 for 95%, and 2.576 for 99% confidence. Use the confidence level requested, and keep the subtraction order in the point estimate and both endpoints.

Why the Standard Error Has This Form

For one independent Bernoulli observation with success probability \(p_j\), the variance is \(p_j(1-p_j)\). The sample proportion is an average of \(n_j\) such observations, so its variance is \(p_j(1-p_j)/n_j\). For independent samples, the variance of a difference is the sum of the two variances:

$$ \operatorname{Var}(\hat p_1-\hat p_2) = \frac{p_1(1-p_1)}{n_1} + \frac{p_2(1-p_2)}{n_2}. $$

The population proportions are unknown, so the Wald method estimates each variance by substituting the corresponding sample proportion. With adequate success and failure counts in both samples, the difference of sample proportions is approximately normal. Standardizing it by the estimated standard error gives the approximate interval formula above. This justification depends on both the independence assumption and a suitable normal approximation; a large total sample alone does not guarantee the approximation is good in each group.

Approximation condition: A common practical check is that, in each sample, both the observed number of outcomes and the observed number of non-outcomes are at least 10: \(n_1\hat p_1\), \(n_1(1-\hat p_1)\), \(n_2\hat p_2\), and \(n_2(1-\hat p_2)\) should each be at least 10. This is a rule of thumb for the normal approximation, not a guarantee of exact coverage. If counts are sparse or a sample proportion is at a boundary, the Wald interval may perform poorly.

Constructing an Interval Step by Step

A reliable calculation separates the estimate, its standard error, and the confidence multiplier. Check the conditions before presenting the interval, and retain enough digits during intermediate calculations to avoid rounding errors.

1
Identify the order.
State which group is population 1 and which is population 2. The parameter and estimate will be group 1 minus group 2.
2
Compute the sample proportions and check counts.
Calculate \(\hat p_1=X_1/n_1\) and \(\hat p_2=X_2/n_2\), then check successes and failures in both samples.
3
Calculate the estimate and standard error.
Subtract the proportions in the stated order, and use each group’s own \(\hat p_j\) and \(n_j\) in the standard-error formula.
4
Apply the critical value and report the interval.
Multiply the estimated standard error by the requested normal critical value, add and subtract the margin from the estimate, and round only at the end.

Worked Example: Comparing Two Hypothetical Enrollment Approaches

In a hypothetical study, 120 of 200 people offered enrollment approach A select an optional feature. Under approach B, 100 of 250 people select it. Construct a 95% Wald confidence interval for \(p_A-p_B\). Treat the two groups as independent random samples.

Method and conditions. This is a Wald interval for two independent proportions. The sample proportions are \(\hat p_A=120/200=0.600\) and \(\hat p_B=100/250=0.400\). The success and failure counts are 120 and 80 for A, and 100 and 150 for B; each is at least 10.

Estimate. The required order is A minus B, so the estimated difference is \(0.600-0.400=0.200\).

Estimated standard error. Use each sample size with its own proportion:

$$ \begin{aligned} \widehat{\operatorname{SE}} &=\sqrt{\frac{0.600(0.400)}{200}+\frac{0.400(0.600)}{250}}\\ &=\sqrt{\frac{0.240}{200}+\frac{0.240}{250}}\\ &=\sqrt{0.001200+0.000960}\\ &=\sqrt{0.002160}=0.0464758\text{ (approximately).} \end{aligned} $$

Margin and interval. For 95% confidence, use \(z_{0.975}=1.960\). The margin is \(1.960(0.0464758)=0.0910926\). Thus the endpoints are \(0.200-0.0910926=0.1089074\) and \(0.200+0.0910926=0.2910926\). Rounded to four decimal places, the interval is \((0.1089,\;0.2911)\).

Check and common mistake avoided. The interval is centered at 0.200, and its half-width is approximately 0.0911. The standard error uses denominators 200 and 250, not the combined total for both variance terms.

Worked Example: A 90% Interval With Unequal Group Sizes

In a hypothetical comparison of two service reminders, 88 of 160 recipients of reminder A and 96 of 240 recipients of reminder B complete a recommended action. Construct a 90% Wald confidence interval for \(p_A-p_B\).

Method and conditions. Use the unpooled estimated standard error for independent samples. The proportions are \(\hat p_A=88/160=0.550\) and \(\hat p_B=96/240=0.400\). Their failure counts are \(160-88=72\) and \(240-96=144\); all four success and failure counts are at least 10.

Estimate. In the stated order, \(\hat p_A-\hat p_B=0.550-0.400=0.150\).

Estimated standard error.

$$ \begin{aligned} \widehat{\operatorname{SE}} &=\sqrt{\frac{0.550(0.450)}{160}+\frac{0.400(0.600)}{240}}\\ &=\sqrt{\frac{0.2475}{160}+\frac{0.2400}{240}}\\ &=\sqrt{0.001546875+0.001000000}\\ &=\sqrt{0.002546875}=0.0504666\text{ (approximately).} \end{aligned} $$

Margin and interval. For a two-sided 90% interval, \(z_{0.95}\approx1.645\). The margin is \(1.645(0.0504666)=0.0830175\). The endpoints are \(0.150-0.0830175=0.0669825\) and \(0.150+0.0830175=0.2330175\). Rounded to four decimal places, the interval is \((0.0670,\;0.2330)\).

Check and common mistake avoided. The interval is centered at 0.150 and has a margin of about 0.0830. Because the sample sizes differ, the two variance contributions have different denominators; replacing them with one shared denominator would not follow the Wald formula.

Worked Example: A Negative Estimate and a 99% Interval

A hypothetical study records an outcome for two independent groups. In group A, 54 of 180 people have the outcome; in group B, 88 of 220 do. Construct a 99% Wald confidence interval for \(p_A-p_B\).

Method and conditions. The proportions are \(\hat p_A=54/180=0.300\) and \(\hat p_B=88/220=0.400\). The success and failure counts are 54 and 126 in A, and 88 and 132 in B, so all four counts exceed 10.

Estimate. The estimate, with A first, is \(0.300-0.400=-0.100\).

Estimated standard error.

$$ \begin{aligned} \widehat{\operatorname{SE}} &=\sqrt{\frac{0.300(0.700)}{180}+\frac{0.400(0.600)}{220}}\\ &=\sqrt{\frac{0.210}{180}+\frac{0.240}{220}}\\ &=\sqrt{0.001166667+0.001090909}\\ &=\sqrt{0.002257576}=0.0475145\text{ (approximately).} \end{aligned} $$

Margin and interval. For 99% confidence, use \(z_{0.995}\approx2.576\). The margin is \(2.576(0.0475145)=0.122397\) (approximately). The endpoints are \(-0.100-0.122397=-0.222397\) and \(-0.100+0.122397=0.022397\). Rounded to four decimal places, the interval is \((-0.2224,\;0.0224)\).

Check and common mistake avoided. The negative estimate is retained because the comparison is A minus B; reversing the subtraction would change the sign of the estimate and the interpretation. The interval is centered at approximately \(-0.1000\), as required.

Interpretation and Common Traps

The endpoints are expressed in proportion units. In the first worked example, for instance, the interval estimates \(p_A-p_B\), not either population proportion separately. A difference of 0.10 corresponds to 10 percentage points. Do not describe a difference of 0.10 as a 10% relative increase: a relative comparison has a different denominator and is not what this interval estimates.

In repeated use of the method under its assumptions, approximately the stated percentage of intervals constructed in this way would contain the fixed population difference. The confidence level is not a probability assigned to the particular fixed difference after the observed interval has been calculated.

  • Reversing the groups. If the target is \(p_1-p_2\), calculate \(\hat p_1-\hat p_2\). Reversing the order reverses the sign of the estimate and the endpoints.
  • Using the total sample size for both variance terms. The first contribution is divided by \(n_1\), and the second by \(n_2\). They need not be equal.
  • Rounding too early. Keep additional digits in the standard error and margin, and round the final endpoints to the requested precision.
  • Ignoring the approximation check. A formula can be evaluated even when counts are sparse, but that does not make its normal-approximation coverage dependable.

Check Your Understanding

For each question, use the stated ordering, check the success and failure counts when constructing an interval, and round interval endpoints to four decimal places.

  1. In a hypothetical comparison, 72 of 120 members of group A and 54 of 150 members of group B have an outcome. Construct a 95% Wald interval for \(p_A-p_B\). (Answer: \(\hat p_A-\hat p_B=0.2400\), \(\widehat{\operatorname{SE}}\approx0.0595\), interval \((0.1235,\;0.3565)\).)
  2. A hypothetical study observes 100 outcomes among 250 people in group A and 110 among 200 people in group B. Construct a 90% Wald interval for \(p_A-p_B\). (Answer: estimate \(-0.1500\), \(\widehat{\operatorname{SE}}\approx0.0469\), interval \((-0.2271,\;-0.0729)\).)
  3. In two independent hypothetical samples, 81 of 180 people in group A and 99 of 220 in group B have an outcome. Construct a 95% Wald interval for \(p_A-p_B\). (Answer: estimate \(0.0000\), \(\widehat{\operatorname{SE}}=0.0500\), interval \((-0.0980,\;0.0980)\).)
  4. A hypothetical study records 240 outcomes among 400 people in group A and 250 among 500 in group B. Construct a 99% Wald interval for \(p_A-p_B\). (Answer: estimate \(0.1000\), \(\widehat{\operatorname{SE}}\approx0.0332\), interval \((0.0146,\;0.1854)\).)
  5. Suppose a calculation uses \(\hat p_A=0.60\), \(n_A=200\), \(\hat p_B=0.40\), and \(n_B=250\). A student divides both variance contributions by \(450\), the combined sample size. State the correct standard error and explain the denominator error. (Answer: \(\sqrt{0.240/200+0.240/250}=\sqrt{0.00216}\approx0.0465\); each estimated variance contribution must be divided by its own group’s sample size.)
Clinical Biostats