Confidence interval for a proportion
Use Wilson for routine estimation of one proportion; choose Clopper-Pearson when guaranteed minimum binomial coverage matters more than interval width.
Fit
When to use it, and when not to
Use it when
- You count people with a binary outcome among a known number assessed once.
- You need uncertainty around a prevalence or fixed-period risk in one group.
Not when
- Your denominator is person-time. Use a Poisson rate interval or count regression. Read: Poisson regression
- You need a ratio comparing two groups. Use an interval for that ratio. Read: Odds ratio and risk ratio from a 2×2 table
- Sampling uses weights or whole clinics. Use a survey or clustered analysis. Read: Complex survey analysis
Before you start
What you need
- Events and people assessedSupply a whole-number event count and denominator. Report missing outcomes and the case definition.
- Confidence level and interval methodChoose the level and whether you want Wilson score coverage or conservative exact coverage before examining results.
- The population and sampling designsamplingStructureclusteredDefine who the estimate describes and how people entered the sample.
- The count follows a binomial model: independent people share one event probability.How to check: Count each person once. Consider weights, finite-population sampling and clustering before using a simple interval.
- Observed outcomes measure the intended condition.How to check: An imperfect screening test estimates apparent prevalence. Neither interval corrects sensitivity, specificity or nonresponse bias.
Plain language
How it works
A binomial proportion is the event count divided by people assessed. A rate here means a share of people, not events per person-time. Wilson inverts a score test, using uncertainty evaluated at each candidate proportion. It usually gives useful width and coverage without the failures of the simple Wald interval.
Clopper-Pearson inverts equal-tailed binomial tests. Discreteness makes it conservative: coverage is at least the stated level, often higher. Use it when a protocol requires that minimum guarantee, including sparse or boundary counts. Wilson also handles zero or all events; it does not guarantee minimum coverage. Choose by coverage needs, not whichever interval looks better.
Worked example
A worked example
- Setting
- A random sample of 40 independent patients includes 7 who screen positive.
- Question
- How uncertain is the apparent prevalence?
- Approach
- Divide positives by all assessed. Compute two-sided 95% Wilson and equal-tailed Clopper-Pearson intervals.
- Result
- The estimate is 17.5 in 100, or 17.5%. The Wilson interval is 8.75% to 31.95%; Clopper-Pearson gives 7.34% to 32.78%.
- What it means
- These methods express sampling uncertainty, not screening accuracy. Exact coverage is at least 95% under the binomial model, often making the interval wider.
In practice
Recent studies PubMed search · not vetted
Watch out
Common mistakes
The one to remember
Wilson and Clopper-Pearson intervals apply to one binomial proportion, not a person-time rate, odds ratio or regression coefficient. Neither fixes selection bias, clustering or an imperfect test.
- Using the simple Wald interval, especially near zero or one.Instead: Use Wilson or Clopper-Pearson. Both stay within the probability scale and avoid the zero-width Wald interval at the boundaries.
- Calling an exact interval exact knowledge of prevalence.Instead: Exact refers to repeated-sampling coverage under the binomial model. It does not remove sampling or measurement bias.
- Treating an estimation interval as a hypothesis test.Instead: The Exact binomial test addresses a specified null proportion. Its two-sided p-value need not invert the equal-tailed Clopper-Pearson interval.
Inside Mallard
How Mallard uses this
The method registry links its single-proportion interval method to this article and code.
single-proportion-wilson-clopper-pearson).analysis.proportion_ci, the id a plan cue records.How to report it
Report the numerator, denominator, case definition, sampling frame, estimate, confidence level and named interval method. State nonresponse, missing outcomes and any survey adjustment. A reporting guideline is not a design manual: use it to make the study transparent, not as a substitute for careful design. Check the target journal's own requirements as well, which this page cannot know.
Related Learn pages
Related designs and methods
Evidence
Sources & further reading
- Two-sided confidence intervals for the single proportion: comparison of seven methods (opens in a new tab) · Stat Med · doi 10.1002/(sici)1097-0258(19980430)17:8<857::aid-sim777>3.0.co;2-e
- Exact likelihood ratio and score confidence intervals for the binomial proportion (opens in a new tab) · Pharm Stat · doi 10.1002/pst.1560