Statistics Quest

Confidence interval for a proportion (Wald, Wilson, Clopper–Pearson)

Intervals for a population proportion; the Wilson score interval is recommended, the Wald interval is simple but unreliable for small n or p near 0 or 1, and Clopper–Pearson is exact and conservative.

p^±z1−α/2p^(1−p^)n\phat \pm z_{1-\alpha/2}\sqrt{\frac{\phat(1-\phat)}{n}}
Wald interval (textbook, not recommended for small samples)
p^\phat
sample proportion x/nx/n
nn
number of trials
z1−α/2z_{1-\alpha/2}
standard normal quantile (1.96 for 95%)
p^+z22n±zp^(1−p^)n+z24n21+z2n\frac{\phat + \frac{z^2}{2n} \pm z\sqrt{\frac{\phat(1-\phat)}{n} + \frac{z^2}{4n^2}}}{1 + \frac{z^2}{n}}
Wilson score interval (recommended)
zz
z1−α/2z_{1-\alpha/2}
[ Bα/2(x, n−x+1),    B1−α/2(x+1, n−x) ]\big[\,B_{\alpha/2}(x,\, n-x+1),\;\; B_{1-\alpha/2}(x+1,\, n-x)\,\big]
Clopper–Pearson (exact) interval
Bq(a,b)B_q(a, b)
the qq quantile of a Beta(aa, bb) distribution; the lower bound is 0 when x=0x = 0 and the upper bound 1 when x=nx = n
xx
number of successes

When to use

Estimating a rate: conversion, default, defect or prevalence rates from xx successes in nn independent trials.

  • Wilson (recommended): good coverage even for small nn or extreme p^\phat; always inside [0, 1].
  • Clopper–Pearson: guaranteed coverage of at least the nominal level; wider (conservative). Common in regulated settings.
  • Agresti–Coull: add z2/2z^2/2 successes and z2/2z^2/2 failures, then use the Wald formula; close to Wilson.
  • Wald: only for large samples with np^n\phat and n(1−p^)n(1-\phat) both comfortably above 10.

Assumptions

Independent trials with a common probability (binomial model); a random sample.

How to interpret

The interval gives plausible values of the population proportion. The Wilson interval is not centred on p^\phat: it is pulled towards 0.5, which corrects the Wald interval's undercoverage.

Common mistakes

  • Using Wald with few successes: it can extend below 0 or above 1 (the engine reports, but does not truncate, such bounds) and its real coverage can be far below 95%.
  • Reporting p^=0\phat = 0 with a zero-width Wald interval when x=0x = 0.
  • Mixing percent and proportion units.

Example

x=18x = 18 of n=60n = 60 (p^=0.30\phat = 0.30), 95%: Wald (0.184,0.416)(0.184, 0.416); Wilson (0.199,0.425)(0.199, 0.425); Clopper–Pearson (0.188,0.432)(0.188, 0.432); Agresti–Coull (0.198,0.426)(0.198, 0.426). With x=2x = 2 of n=20n = 20: Wald gives (−0.031,0.231)(-0.031, 0.231), an impossible lower bound; Wilson gives (0.028,0.301)(0.028, 0.301).