Research toolsEstimation
Confidence interval for a proportion
Computes a confidence interval for an observed proportion using both the Wilson score method and the classical Wald method, so the difference between them is visible.
Results
- Observed proportion
- 45.0%0.4500
- Wilson score interval (95%)
- 35.6% to 54.8%0.3561 to 0.5476
- Wald interval (95%)
- 35.2% to 54.8%0.3525 to 0.5475
- Interval width (Wilson)
- 19.1%
Report the Wilson interval. The Wald interval is shown only so you can see where the two diverge — try 0 events out of 20.
When to use it
- Reporting a prevalence, a response rate, or a diagnostic proportion.
- Any time a percentage is reported from a finite sample — a proportion without an interval is an incomplete result.
- Especially when the proportion is near 0% or 100%, or the sample is small, where the Wald interval fails.
Formula
Wilson score interval (recommended):
p̂ + z²/2n ± z · √( p̂(1−p̂)/n + z²/4n² )
CI = ──────────────────────────────────────────────
1 + z²/n
Wald interval (shown for comparison only):
CI = p̂ ± z · √( p̂(1−p̂) / n )
p̂ = x / n, the observed proportion
z = 1.959964 for a 95% intervalWorked example
45 events observed out of 100 participants.
- Events
- 45
- Sample size
- 100
- Confidence level
- 95%
Proportion 0.450. Wilson interval 0.356 to 0.548. Wald interval 0.352 to 0.548.
The two agree closely here because the proportion is near 0.5 and the sample is reasonably large. At 0 events out of 20 they do not: Wald gives the useless interval 0 to 0, while Wilson gives 0 to 0.161.