Premed · Premed · Statistics Biostatistics

Lecture 13: Confidence Intervals for Proportions

Statistics / Biostatistics


Learning Objectives

By the end of this lecture, students will be able to:

  1. Construct a confidence interval for a single population proportion
  2. Determine the sample size needed for estimating a proportion with a given margin of error
  3. Construct a confidence interval for the difference between two proportions
  4. Interpret confidence intervals for proportions in clinical and epidemiological settings
  5. Describe alternative methods (Wilson, exact) for small-sample proportions

Lecture Content

I. The Sample Proportion

The population proportion (p) is the fraction of the population with a given characteristic, while the sample proportion (p-hat) equals x / n, where x is the number of successes in n trials. By the Central Limit Theorem, for large n, p-hat is approximately normally distributed with E(p-hat) = p and SE(p-hat) = sqrt[p(1-p) / n]. The normal approximation requires that np >= 5 and n(1-p) >= 5.

II. Wald Confidence Interval for a Proportion

The standard (Wald) confidence interval for a proportion is p-hat +/- z_(alpha/2) * sqrt[p-hat(1 - p-hat) / n]. For a 95% CI, z_(0.025) = 1.96.

As an example, in a sample of 200 patients, 60 developed an infection, so p-hat = 60/200 = 0.30. The standard error is sqrt(0.30 0.70 / 200) = sqrt(0.00105) = 0.0324. The 95% CI is 0.30 +/- 1.96 0.0324 = 0.30 +/- 0.064 = (0.236, 0.364). We are 95% confident the true infection rate is between 23.6% and 36.4%.

III. Limitations of the Wald Interval

The Wald interval can perform poorly in several situations. When the sample size is small, when p is near 0 or 1 (where the boundaries produce asymmetric or impossible intervals), the interval may extend below 0 or above 1. More importantly, the coverage probability -- the actual proportion of times the CI contains the true p -- can be substantially below the nominal level for small n or extreme p values.

IV. Alternative Methods

Several alternatives address the limitations of the Wald interval. The Wilson (score) interval has better coverage properties, especially for small n, and is recommended as the default by many statisticians. Its formula is more complex but is available in standard software.

The Agresti-Coull interval provides a simple adjustment: add 2 successes and 2 failures to the data, computing p-tilde = (x + 2) / (n + 4) and using p-tilde in place of p-hat in the Wald formula with n + 4 in the denominator. This small adjustment greatly improves coverage.

The Clopper-Pearson (exact) interval is based on the exact binomial distribution. It is conservative, meaning its coverage is always at or above the nominal level, but it is often wider than necessary. It is used when exactness is required, such as in regulatory submissions.

<image>A comparison plot of CI methods for a proportion. The x-axis shows the true proportion p from 0 to 1. The y-axis shows the actual coverage probability of each method at nominal 95%. Four lines are plotted: Wald (oscillating well below 95% near the boundaries and for small n), Wilson (staying close to 95% throughout), Agresti-Coull (similar to Wilson), and Clopper-Pearson (always at or above 95%, conservative). A horizontal dashed line at 0.95 marks the target. Sample size n = 30 is noted.</image>

V. Sample Size for Estimating a Proportion

To achieve a margin of error E at confidence level (1-alpha), the required sample size is n = [z_(alpha/2)]^2 p(1-p) / E^2. If no prior estimate of p is available, using p = 0.5 maximizes p(1-p) and gives the most conservative (largest) sample size estimate: n = [z_(alpha/2)]^2 0.25 / E^2.

For example, to estimate an infection rate within +/- 5 percentage points with 95% confidence, n = (1.96)^2 0.25 / (0.05)^2 = 3.8416 0.25 / 0.0025 = 384.16, rounding up to n = 385. If prior data suggest p is approximately 0.10, the calculation becomes n = (1.96)^2 0.10 0.90 / (0.05)^2 = 138.3, rounding up to n = 139. Having a reasonable prior estimate of p can substantially reduce the required sample size.

VI. CI for the Difference Between Two Proportions

When comparing proportions from two independent groups, the standard CI for p-hat1 - p-hat2 is (p-hat1 - p-hat2) +/- z_(alpha/2) * sqrt[p-hat1(1-p-hat1)/n1 + p-hat2(1-p-hat2)/n2].

As an example, in a treatment group 80/200 = 0.40 respond, while in a control group 50/200 = 0.25 respond. The difference is 0.40 - 0.25 = 0.15. The standard error is sqrt(0.400.60/200 + 0.250.75/200) = sqrt(0.00120 + 0.000938) = sqrt(0.002138) = 0.0462. The 95% CI is 0.15 +/- 1.96 * 0.0462 = 0.15 +/- 0.091 = (0.059, 0.241). Since the CI excludes 0, the treatment group has a significantly higher response rate.

<image>A forest plot-style display showing the confidence interval for the difference in proportions. A horizontal number line with 0 marked by a vertical dashed line. The point estimate (0.15) is shown as a square, and the 95% CI (0.059 to 0.241) extends as a horizontal line. Since the entire CI is to the right of zero, an annotation reads "Statistically significant: treatment has higher response rate." A second example below shows a CI that crosses zero, annotated as "Not statistically significant."</image>

VII. Clinical Applications

Confidence intervals for proportions have wide-ranging clinical applications. They are used for estimating the prevalence of a disease in a population, comparing cure rates between two treatments in a clinical trial, estimating vaccination coverage in a community, reporting adverse event rates with associated uncertainty, and comparing screening test positivity rates across sites. In regulatory settings, CIs for proportions are required in drug approval submissions to demonstrate both the magnitude and precision of treatment effects.

VIII. Reporting Confidence Intervals

When reporting results, always include both the point estimate and the confidence interval, and state the confidence level (usually 95%). In tables, the standard format is "40.0% (95% CI: 33.2%-46.8%)." Confidence intervals convey more information than p-values alone because they show both the magnitude and precision of the estimate. A narrow CI indicates a precise estimate, while a wide CI indicates substantial uncertainty about the true value.

<image>A summary table from a hypothetical clinical trial report. Columns: Outcome, Treatment Group (n, events, %), Control Group (n, events, %), Difference (95% CI), P-value. Rows include: Primary endpoint (response rate), Secondary endpoint (adverse event rate), and a third endpoint (mortality). CIs are displayed both numerically and as small inline forest plots. The table demonstrates how CIs and p-values complement each other in communicating results.</image>


Lecture 13: Confidence Intervals for Proportions — figure 1
Lecture 13: Confidence Intervals for Proportions — figure 2
Lecture 13: Confidence Intervals for Proportions — figure 3

Read this lecture as Markdown