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.
- sample proportion
- number of trials
- standard normal quantile (1.96 for 95%)
- the quantile of a Beta(, ) distribution; the lower bound is 0 when and the upper bound 1 when
- number of successes
When to use
Estimating a rate: conversion, default, defect or prevalence rates from successes in independent trials.
- Wilson (recommended): good coverage even for small or extreme ; always inside [0, 1].
- Clopper–Pearson: guaranteed coverage of at least the nominal level; wider (conservative). Common in regulated settings.
- Agresti–Coull: add successes and failures, then use the Wald formula; close to Wilson.
- Wald: only for large samples with and 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 : 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 with a zero-width Wald interval when .
- Mixing percent and proportion units.
Example
of (), 95%: Wald ; Wilson ; Clopper–Pearson ; Agresti–Coull . With of : Wald gives , an impossible lower bound; Wilson gives .