Sample Size Calculator

Single proportion

Determines the sample size required to estimate a population proportion with a specified margin of error at a chosen confidence level.

Key takeaways

  • What is calculated: Determine the smallest n at which the confidence interval for the proportion has half-width no greater than d.
  • Quantities you must supply: Expected proportion; Absolute precision — half-width; Significance level.
  • Type of calculation: Precision-based: it answers how precisely the quantity can be estimated. There is no alternative hypothesis, and no power value is involved.
  • Calculation routes: 4 are available for this design; the one selected determines the formula, the quantities requested and the result.

Methods available for Single proportion

  • Wald (normal approximation), absolute precision Sample size to estimate a proportion within a stated number of percentage points, using normal quantiles. It is the standard textbook calculation, reproducible by hand and by every other sample-size tool, which matters when the figure has to be defended in a protocol.
  • Wilson score interval, absolute precision Precision-based sample size from the score interval, which keeps its coverage when the proportion is small. Wald coverage falls well below nominal for extreme proportions; the score interval holds close to nominal across the range, so the study delivers the precision it planned for.
  • Clopper-Pearson exact interval Precision-based sample size from the exact binomial interval, which guarantees at least nominal coverage at every n and p. Wald and Wilson coverage are asymptotic guarantees; only the exact interval holds the nominal level for every n, which is what a regulator or an accreditation standard usually requires.
  • Normal approximation, relative precision Sample size to estimate a proportion within a stated percentage of its own value rather than a fixed margin. For rare outcomes the useful question is how precisely the prevalence is known relative to its size, not how many percentage points wide the interval is.

When to use

Use when the primary objective is to determine how accurately the study can estimate a population proportion, prevalence, or rate within a specified margin of error.

Sample size

Use 0.5 for the most conservative sample size under absolute precision.

Type I error rate.

A two-sided alternative gives an interval spending α/2 in each tail; a one-sided alternative gives an upper or lower bound spending all of α in one tail, and needs a smaller n.

Applies the finite population correction when > 0.

Final n is inflated by 1/(1 − dropout).

Reset to defaults

Awaiting inputs

Set the parameters and calculate.

Methodology — Single proportion — Wald interval, absolute precision

Formula used Single proportion — Wald interval, absolute precision

n=z1α/22p(1p)d2
Required sample size
  • nadj=n1+(n1)/N Finite population correction
  • z1α/2(two-sided)in place ofz1α(one-sided) Two-sided alternative selected: α is split between both tails, so the larger quantile is used and the requirement rises

where —

p
Anticipated proportion. 0 – 1 exclusive
d
Absolute precision — half-width of the interval. 0.0001 – 0.5; commonly 0.05 or 0.10
α
Probability of rejecting a true null hypothesis (Type I error). 0.0001 – 0.5; conventionally 0.05, or 0.025 one-sided for regulatory non-inferiority
N
Size of the population being sampled. 0 (infinite) or any positive integer
Expected proportion of enrolled units lost before analysis. 0 – 0.95

Formulas for the 4 methods

Calculation methodFormula
Wald (normal approximation), absolute precision
n=z1α/22p(1p)d2
Wilson score interval, absolute precision
n=z1α/22v
Clopper-Pearson exact interval
pUpL2d
Normal approximation, relative precision
n=z1α/22(1p)ε2p

How this method works

The half-width of a normal-theory interval for a proportion is z·sqrt(p(1−p)/n); solving for n gives the requirement. Variance is maximised at p = 0.5, which is why 0.5 is the conservative default when no prior estimate exists.

Selected method — Wald interval inverted for n. Variance is maximised at p = 0.5, so entering 0.5 when no prior estimate exists gives the safest size — at α = 0.05 and d = 0.05 this is the familiar n = 384.

Absolute precision behaves poorly for rare outcomes and the Wald interval can extend beyond 0 or 1 at small n. Where either applies, use the Wilson method or switch to relative precision.

Calculation procedure

  1. State the proportion you expect, p; use p=0.5 when nothing is known, since p(1p) is largest there.
  2. State the half-width d — the margin of error the report will quote, such as ±0.05.
  3. Take z1α/2=1.96 for 95% confidence.
  4. Evaluate n=z1α/22p(1p)d2.
  5. Apply the finite population correction if it applies, round up, then inflate for non-response.

Exact or approximate

Approximate. The Wald interval under-covers, particularly for p away from 0.5, so the resulting interval is slightly wider in practice than planned.

The formula shown always matches what was computed: when a one-sided test is selected the rendered quantile changes from z1−α/2 to z1−α, and where several methods exist, the formula follows the method selected in the calculator.

Advantages & limitations

Advantages

  • Simple, transparent and reproducible by hand.
  • Directly links sample size to the precision the study will report.
  • Matches the figure quoted in standard survey textbooks and by other calculators.

Limitations

  • Coverage is poor for p near 0 or 1, and the interval can extend beyond the possible range.
  • Requires an estimate of p that the study has not yet made.
  • Assumes simple random sampling; clustered designs need a design effect.
  • Halving d quadruples the requirement.

Assumptions

  • Observations are independent Bernoulli trials.
  • The normal approximation to the binomial is adequate at the resulting n.
  • Simple random sampling unless a design effect is applied separately.
  • The anticipated proportion is a reasonable estimate; 0.5 is the conservative choice.

Applicable adjustments

Supports the finite population correction and non-response inflation. Clustered sampling requires a design effect applied before them.

Conclusion

Report the assumed proportion, the precision and the confidence level. Where p is uncertain, compute across a plausible range and report the range.

References

  1. Lemeshow S, Hosmer DW, Klar J, Lwanga SK. Adequacy of Sample Size in Health Studies. Geneva: WHO/Wiley; 1990.
  2. Cochran WG. Sampling Techniques. 3rd ed. New York: Wiley; 1977.
  3. Wilson EB. Probable inference, the law of succession, and statistical inference. J Am Stat Assoc. 1927;22(158):209–212. Link
  4. Brown LD, Cai TT, DasGupta A. Interval estimation for a binomial proportion. Stat Sci. 2001;16(2):101–133. Link
  5. Naing L, Winn T, Rusli BN. Practical issues in calculating the sample size for prevalence studies. Arch Orofac Sci. 2006;1:9–14.