Sample Size Calculator

Single mean

Determines the sample size required to estimate a population mean with a specified margin of error (precision) at a chosen confidence level.

Key takeaways

  • What is calculated: Determine the smallest n at which the confidence interval for the mean has half-width no greater than E.
  • Quantities you must supply: Standard deviation; 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: 3 are available for this design; the one selected determines the formula, the quantities requested and the result.

Methods available for Single mean

  • Z-based, absolute precision Sample size to estimate a mean within a stated margin of error, using normal quantiles. Chosen when precision, not detection, is the design objective. It involves no alternative hypothesis, no β and no power.
  • Iterative t-based, absolute precision Precision-based sample size using the t quantile, solved iteratively because the quantile depends on n. Chosen because it matches the interval that will actually be reported. The z-based method plans for an interval narrower than the one the analysis will produce.
  • Z-based, relative precision Precision expressed as a proportion of the mean rather than in outcome units. Chosen when the scientific requirement is proportional accuracy rather than a fixed margin, and when the anticipated mean is known well enough to convert one to the other.

When to use

Use when the primary objective is to determine how accurately the study can estimate a population mean within a specified margin of error at a chosen confidence level.

Sample size

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 mean — Z-based absolute precision

Formula used Single mean — Z-based absolute precision

n=(z1α/2σE)2
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 —

σ
Expected standard deviation of the outcome. σ > 0
E
Maximum acceptable half-width of the confidence interval, in outcome units. E > 0
α
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 3 methods

Calculation methodFormula
Z-based, absolute precision
n=(z1α/2σE)2
Iterative t-based, absolute precision
n(i+1)=t1α/2,n(i)12σ2E2
Z-based, relative precision
n=z1α/22σ2E2=z1α/22ε2(σμ)2

How this method works

An estimation calculation, not a test. The half-width of a normal-theory confidence interval is E = z₁₋α/₂σ/√n; solving for n gives the requirement directly.

The half-width of a normal-theory confidence interval is E = z₁₋α/₂·σ/√n; solving for n gives the requirement in closed form. Halving E quadruples n.

No alternative hypothesis and no power term enter a precision calculation.

Calculation procedure

  1. Decide how precise the estimate must be: E is the half-width of the interval you are willing to report, in the units of the outcome.
  2. Supply the expected spread of the outcome, σ, from a pilot study, published work or the range rule σrange/4.
  3. Take the normal quantile for the confidence level: z1α/2=1.96 at α=0.05.
  4. Evaluate n=(z1α/2σE)2. Halving E multiplies n by four.
  5. Apply the finite population correction if the population is small and enumerable, round up, then inflate for non-response.

Exact or approximate

Approximate — it uses the normal quantile in place of the t quantile that the realised interval will actually use.

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, closed-form and universally recognised.
  • Requires only σ, α and the target precision.

Limitations

  • Slightly understates n, because the realised interval uses a t quantile which exceeds the normal one.
  • Precision is conditional on σ being correct; an underestimated σ produces an interval wider than planned.

Assumptions

  • Observations are independent and identically distributed.
  • The sampling distribution of the mean is approximately normal.
  • σ is known, or estimated well enough that the normal quantile applies.
  • Simple random sampling unless a design effect is applied.

Applicable adjustments

Supports finite population correction, design effect and non-response inflation. Power adjustments do not apply.

Conclusion

A straightforward precision calculation requiring only σ, α and the margin of error. Report the resulting interval width alongside n, and remember the figure carries no statistical power.

References

  1. Cochran WG. Sampling Techniques. 3rd ed. New York: Wiley; 1977.
  2. Lemeshow S, Hosmer DW, Klar J, Lwanga SK. Adequacy of Sample Size in Health Studies. Geneva: WHO/Wiley; 1990.
  3. Rosner B. Fundamentals of Biostatistics. 8th ed. Boston: Cengage; 2015.