Ask Mallard
Analysis method

Confidence interval for a proportion

5 min read

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

Before you start

What you need

Decide these first
  1. Events and people assessedSupply a whole-number event count and denominator. Report missing outcomes and the case definition.
  2. Confidence level and interval methodChoose the level and whether you want Wilson score coverage or conservative exact coverage before examining results.
  3. The population and sampling designsamplingStructureclusteredDefine who the estimate describes and how people entered the sample.
It rests on these
  1. 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.
  2. 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.

Which 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.

One count, two interval constructions
Binomial event count and denominator. Then Wilson score interval. Then Clopper-Pearson exact interval.Confidence interval for a proportionBinomial event count anddenominatorWilson score intervalClopper-Pearson exactintervalChoose by coverage needs; both estimate one binomial proportion.
Conceptual diagram. It shows the structure of the idea, not data from any study.

Worked example

A worked example

Invented for illustration
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

Searching PubMed…

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.

Code example in Mallard: A single proportion with Wilson and Clopper-Pearson intervals (single-proportion-wilson-clopper-pearson).
Sample size: Mallard sizes the main comparison with proportion precision. It does not size adjustment or any secondary analysis.
Atlas node 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.

Code for this method
Loading…

Related Learn pages

Related designs and methods

Evidence

Sources & further reading

  1. 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
  2. Exact likelihood ratio and score confidence intervals for the binomial proportion (opens in a new tab) · Pharm Stat · doi 10.1002/pst.1560
Prepared with AI assistance. PubMed records checked by title, authors, publication year and DOI on 2026-11-07: record verified, confirm it supports this use. No independent professional approval is claimed. Newcombe compares single-proportion interval performance; Somerville and Brown compare methods requiring minimum nominal coverage, including Clopper-Pearson. The Wilson (1927) and Clopper-Pearson (1934) classics are not indexed in PubMed; title searches found no records, so no PMID is invented for them. The indexed comparisons are cited instead.
Last source review: 2026-11-07
AI-generated educational content
Mallard uses reputable methodological and reporting sources, but this material may contain errors or omit important context. Verify important methodological decisions with the cited sources and, when appropriate, a qualified research methodologist or statistician.