Confidence Interval for a Single Proportion

Estimate a population proportion with three methods: Wald, Wilson Score, and Exact (Clopper-Pearson).

Overview

A confidence interval for a proportion quantifies the uncertainty in an estimated proportion. For example, if 72 out of 200 patients respond to a treatment, the point estimate is 36%, but how precise is that estimate?

Statulator provides three methods, each with different properties. The Wald method is the simplest but performs poorly when the proportion is near 0 or 1 or when n is small. The Wilson Score method is recommended for most purposes. The Exact (Clopper-Pearson) method guarantees at least the nominal coverage and is the most conservative.

Worked Example

Scenario: Surgical Complication Risk

A surgeon reviewed n = 150 procedures and found x = 12 complications. Estimate the complication risk with a 95% confidence interval.

Using Statulator:

1 Open the CI for a Single Proportion calculator.

2 Enter Number of Successes (x) = 12 and Sample Size (n) = 150.

3 Set Confidence Level to 95%.

4 Results (p̂ = 0.08):

MethodLowerUpper
Wald0.0370.123
Wilson Score0.0460.135
Exact (Clopper-Pearson)0.0420.136

Interpretation Guide

All three methods estimate the complication risk at about 8%, with the interval spanning roughly 4–14%. The Wald interval is slightly narrower but may undercover (actual coverage < 95%) for small proportions. The Wilson interval shifts the centre slightly towards 0.5, giving better coverage. The Exact interval is the widest and guarantees at least 95% coverage.

Which method to choose? Wilson Score is recommended as the default. Use Exact when conservative coverage is essential (e.g., regulatory submissions). Avoid Wald when p is near 0 or 1, or when n < 40.

Formula

Wald Interval
\[ \hat{p} \pm z_{\alpha/2} \sqrt{\frac{\hat{p}(1-\hat{p})}{n}} \]
Wilson Score Interval
\[ \frac{\hat{p} + \dfrac{z^2}{2n} \pm z\sqrt{\dfrac{\hat{p}(1-\hat{p})}{n} + \dfrac{z^2}{4n^2}}}{1 + \dfrac{z^2}{n}} \]
Exact (Clopper-Pearson) Interval
\[ \text{Lower} = B\!\left(\frac{\alpha}{2};\; x,\; n-x+1\right) \quad;\quad \text{Upper} = B\!\left(1-\frac{\alpha}{2};\; x+1,\; n-x\right) \]

where \( B(p;\,a,\,b) \) is the inverse of the Beta CDF (quantile function).

where \( \hat{p} = x/n \), \( z = z_{\alpha/2} \), and \( \alpha = 1 - \text{confidence level} \).

Assumptions & Requirements

Textbook Examples

Medicine

In a cohort of 200 post-surgical patients, 34 developed an infection. Estimate the infection risk with a 95% CI.

Inputs: x = 34, n = 200, confidence = 95%.
Result: p̂ = 0.17; Wilson 95% CI: (0.124, 0.228).
Interpretation: The estimated infection risk is 17%, and we are 95% confident the true risk lies between 12.4% and 22.8%.

Education

A survey of 500 university students finds that 320 prefer online lectures. Estimate the proportion with 99% confidence.

Inputs: x = 320, n = 500, confidence = 99%.
Result: p̂ = 0.64; Wald 99% CI: (0.585, 0.695).
Interpretation: About 64% of students prefer online lectures, with 99% confidence the true figure is between 58.5% and 69.5%.

Engineering

Out of 1,000 microchips tested, 12 are defective. Estimate the defect rate with a 95% CI.

Inputs: x = 12, n = 1000, confidence = 95%.
Result: p̂ = 0.012; Exact (Clopper-Pearson) 95% CI: (0.006, 0.021).
Interpretation: The defect rate is about 1.2%. The exact interval (preferred for small proportions) ranges from 0.6% to 2.1%.

Social Science

A political poll of 1,200 voters finds 540 support a referendum. Compute a 95% CI for the support level.

Inputs: x = 540, n = 1200, confidence = 95%.
Result: p̂ = 0.45; Wilson 95% CI: (0.422, 0.478).
Interpretation: Support is estimated at 45%. Since the CI excludes 50%, the referendum appears unlikely to pass based on this sample.

References

  1. Wilson, E. B. (1927). Probable inference, the law of succession, and statistical inference. Journal of the American Statistical Association, 22(158), 209–212.
  2. Clopper, C. J., & Pearson, E. S. (1934). The use of confidence or fiducial limits illustrated in the case of the binomial. Biometrika, 26(4), 404–413.
  3. Brown, L. D., Cai, T. T., & DasGupta, A. (2001). Interval estimation for a binomial proportion. Statistical Science, 16(2), 101–133.
  4. Agresti, A., & Coull, B. A. (1998). Approximate is better than “exact” for interval estimation of binomial proportions. The American Statistician, 52(2), 119–126.