Method document
Sample size to estimate a mean
How many participants are needed to estimate the average of a continuous measurement, such as blood pressure or a biomarker level, so that its confidence interval extends no more than a chosen margin either side of the estimate. Covers finite populations, cluster sampling, stratified sampling and non-response.
https://statwisely.com/methods/precision-mean/
When to use it
- A study of one population, with no comparison group, whose aim is to estimate the average level of a continuous measurement.
- An objective stated as a precision, for example “to estimate mean systolic blood pressure to within ±2 mmHg”.
Not for
- Comparing two groups. Use the difference between two means, or a powered test under “Detect an effect”.
- Strongly skewed measurements whose natural summary is the median, such as length of stay or income. Use the median.
- Before-and-after measurements on the same people. Use the paired mean difference.
Notation
- Sample size under simple random sampling
- Standard deviation of the measurement
- Margin of error: the half-width of the confidence interval, in the measurement’s units
- Number of groups, each planned to the same precision
- Standard normal quantile for confidence 1 − α (1.960 for 95%)
- Population size
- Design effect
- Intracluster correlation coefficient (ICC)
- Usable observations per cluster
- Number of clusters
- Coefficient of variation of cluster size
- Clusters in the population
- Population share of stratum h
- Sample share of stratum h, set by the allocation
- Low and high ends of the range of cluster values
- Non-response rate
Formulas
Simple random sampling
The normal-approximation interval for a mean, solved for n [1, 2]. The interval actually reported will use t rather than z, which makes it slightly wider when n is small; below about 30 participants, add one or two.
Several groups
Optional. When a mean is wanted in each of g independent groups, each group needs the one-group n. Read together, g intervals each at 95% all hold less than 95% of the time; choosing simultaneous intervals splits α across the groups (Bonferroni), which guarantees the joint level at the cost of a larger n in each group. Cluster sampling is not offered with several groups, and a population size applies to each group.
Finite population correction
Applied when a population size is given [1]. It matters only when the sample is a sizeable share of the population, and is not offered with cluster sampling.
Design effect from an ICC
For clusters of equal size [3]. A design effect can also be entered directly, in which case no ICC is used.
Unequal cluster sizes
When each cluster is given its own share s_j of the sample, the CV of those shares enlarges the design effect [4]. With a design effect entered directly the shares only divide the sample, since a measured design effect already reflects its survey’s cluster sizes.
Number of clusters for a chosen cluster size
The requirement is rounded up to whole clusters, so the total can exceed n × DE slightly. At least two clusters are needed to estimate between-cluster variation.
Cluster size for a fixed number of clusters
Solving k·m = n·DE for m. Below that number of clusters no cluster size reaches the margin, because each extra person per cluster adds less and less information; the calculator reports the minimum number of clusters instead.
ICC from a range across clusters
When no ICC is available: the range within which most clusters’ values are expected to fall is taken as about four between-cluster standard deviations, and the ICC is their share of the outcome variance σ². An elicitation aid, not a measurement.
Sampling a share of a finite set of clusters
Optional. When the clusters sampled are a sizeable share of the C there are, the between-cluster part of the variance shrinks by 1 − k/C, and the number of clusters has the closed form shown [1]. People within a cluster are taken as a small share of it, the cautious side. The people-level correction does not apply to a cluster sample.
Stratified sampling
Optional. When every stratum (region, urban or rural area) is sampled, the strata add no design effect of their own; an allocation away from the population shares weights respondents unequally, which costs the combined estimate Kish’s weighting effect DE_w, 1 for proportional allocation [3]. It multiplies the cluster design effect when clusters are sampled within the strata. Every stratum can instead be sized for its own margin, and finite strata carry their own corrections: see “Sample size for a stratified survey” for the allocations, those options and worked examples.
Few clusters
Optional. With few clusters the interval is built on k − 1 degrees of freedom, so the normal critical value is replaced by t. Because k depends on n, this is iterated until it settles.
Non-response
The number to approach so that n respond. Applied last, after any clustering.
Parameters
Confidence level
Values: 90%, 95% or 99%
95% is the convention in health research. A higher level widens the interval, so the same margin needs a larger sample.
Margin of error
Values: Above 0, in the same units as the measurement
The largest distance between the estimate and the true mean you can accept. Choose it from how the estimate will be used, such as the smallest difference that would matter clinically.
Standard deviation
Values: Above 0, in the measurement’s units
Prefer, in order: a comparable published study; a pooled SD from several studies; pilot data. As a rough fallback only, the expected range divided by 4. The sample size grows with the square of the SD, so an underestimate is costly; check a larger value too.
Number of groupsOptional
Values: A whole number of at least 1; 1 for one sample
The independent groups, such as study arms or exposure categories, in which the same estimate is wanted.
Simultaneous intervals across groupsOptional
Values: On or off
Turn on when the groups will be compared or read together, so that every interval holds at once.
Population sizeOptional
Values: A whole number of at least 2
Leave empty for a large population. It matters only when the sample would be more than about 5% of the population. Not available with cluster sampling.
Expected non-response rateOptional
Values: 0% up to, but not including, 100%
The share of people approached who will not take part; use the response rate of a comparable study. Approaching more people restores the number of respondents, not their representativeness: if non-responders differ, the estimate can still be biased.
Intracluster correlation (ICC)Optional
Values: From 0 to 1
The share of the outcome’s variation that lies between clusters. Published ICCs for health outcomes in primary-care and community clusters are mostly small, often below 0.05 [6], but depend on the outcome and the kind of cluster; prefer an estimate from a comparable study.
Range of values across clustersOptional
Values: Two values in the outcome’s units, the first below the second
An alternative to the ICC: the range within which you expect most clusters’ values to fall. It is converted to an ICC by the formula above.
Design effectOptional
Values: Above 0; usually between 1 and 3
An alternative to the ICC, when a previous study of the same design reports its design effect.
Observations per clusterOptional
Values: A whole number of at least 1
Usable responses per cluster. Larger clusters are cheaper to reach, but when the ICC is above zero each additional person in a cluster adds less information.
Number of clustersOptional
Values: A whole number of at least 2
Instead of a cluster size, when the clusters are fixed: the emirates of a country, the schools of a district. The calculator then finds the cluster size, or reports how many clusters the margin needs.
Share of the sample for each clusterOptional
Values: One positive value per cluster, on any scale
When clusters will contribute unequally, for example in proportion to their population. With an ICC, unequal shares enlarge the design effect [4].
Population share of each stratumOptional
Values: Positive, adding to 100%, for at least two strata
Tick “Stratified sampling” to use it. From a census or sampling frame.
Allocation across strataOptional
Values: Proportional, square root, equal, Neyman or custom
Proportional costs nothing; move towards equal when small strata must be reported on.
What the margin is forOptional
Values: The combined estimate, or every stratum on its own
Every stratum on its own usually costs far more people.
Clusters in the populationOptional
Values: A whole number, at least the clusters sampled
Leave empty when the clusters sampled are a small share of all there are. Give it when they are not, say 20 of 40 districts; the design effect then falls.
Correction for few clustersOptional
Values: On or off
Uses t on k − 1 degrees of freedom instead of the normal distribution. Worth applying when there are few clusters, roughly fewer than 30.
Assumptions
- Participants, or clusters, are selected at random, and respond independently apart from the clustering specified.
- The sample mean is approximately normal. This holds for most measurements at these sample sizes; for very skewed ones, estimate the median or analyse on a log scale.
- The standard deviation is a planning value. If the true SD is larger, the achieved margin is wider in the same proportion.
- With cluster sampling: one ICC applies to every cluster; clusters are of equal size unless shares are given; the sampled clusters are a small fraction of all clusters; and the analysis accounts for the clustering, for example with survey-design standard errors [3, 5].
- Non-response is unrelated to the outcome.
Worked examples
Estimating a mean
SD 10, margin ±2, 95% confidence: n = (1.96 × 10 / 2)² = 96.04, rounded up to 97.
Sample size: 97
Open this example in the calculatorProtocol statement
To estimate a mean with 95% confidence and a margin of error of ±2, assuming a standard deviation of 10, the required sample size is 97 participants. Calculated with StatWisely (statwisely.com) using: n = ((z_(1-α/2) × σ) / E)². These are planning estimates; confirm the final design with a qualified statistician.
Allowing for non-response
Expecting 15% not to take part: 97 / (1 − 0.15) = 114.1, so 115 are approached for 97 to respond.
Needed for analysis: 97 · To approach: 115
Open this example in the calculatorA small population
In a population of 500: 97 / (1 + 96 / 500) = 81.4, rounded up to 82.
Sample size: 82
Open this example in the calculatorCluster sampling with an ICC
ICC 0.05 and 10 per cluster: DE = 1 + 9 × 0.05 = 1.45. Then 97 × 1.45 = 140.7, so ⌈140.7 / 10⌉ = 15 clusters and 150 participants.
Sample size: 150
Open this example in the calculatorProtocol statement
To estimate a mean with 95% confidence and a margin of error of ±2, assuming a standard deviation of 10, 97 participants would be required under simple random sampling. Allowing for a design effect of 1.45 (ICC 0.05, 10 per cluster) for cluster sampling, the required sample size is 150 participants, in 15 clusters of 10. This assumes clusters of equal size, with a negligible sampling fraction. Calculated with StatWisely (statwisely.com) using: n = ((z_(1-α/2) × σ) / E)²; clustered: n x DE, DE = 1 + (m-1)ρ. These are planning estimates; confirm the final design with a qualified statistician.
Cluster sampling with a range instead of an ICC
Cluster means are expected to lie between 45 and 55: ρ ≈ (10 / 4)² / 10² = 0.0625, so DE = 1 + 9 × 0.0625 = 1.5625. Then 97 × 1.5625 = 151.6, so 16 clusters of 10 and 160 participants.
Sample size: 160
Open this example in the calculatorA mean in each of three groups
The same SD and margin in each of 3 groups, read together: α is split three ways, z₁₋₀.₀₅/₆ = 2.394, so n = (2.394 × 10 / 2)² = 143.3, rounded up to 144 per group and 432 in all.
144 per group · Total: 432
Open this example in the calculatorValidation
- Every worked example on this page is recomputed by the StatWisely engine whenever the software is built. If a number or formula here stopped matching the calculator, the release would be stopped until this document was corrected.
- An independent implementation in R recomputes this procedure, with and without cluster sampling, every night and before each production release, and the results are compared with the engine’s.
- The basic result agrees with the closed form: (1.96 × 10 / 2)² = 96.04, rounded up to 97. In R, ceiling((qnorm(0.975) * 10 / 2)^2) returns 97.
How to cite
StatWisely. Sample size to estimate a mean. Method document, engine version 1.0.0, reviewed 2026-10-08. https://statwisely.com/methods/precision-mean/
Cite the original references for the formulas your design uses as well.
References
- 1.Cochran WG. Sampling Techniques. 3rd ed. New York: John Wiley & Sons; 1977.
- 2.Julious SA. Sample Sizes for Clinical Trials. Boca Raton: Chapman & Hall/CRC; 2010.
- 3.Kish L. Survey Sampling. New York: John Wiley & Sons; 1965.
- 4.Eldridge SM, Ashby D, Kerry S. Sample size for cluster randomized trials: effect of coefficient of variation of cluster size and analysis method. International Journal of Epidemiology. 2006;35(5):1292–1300. doi:10.1093/ije/dyl129
- 5.Donner A, Klar N. Design and Analysis of Cluster Randomization Trials in Health Research. London: Arnold; 2000.
- 6.Adams G, Gulliford MC, Ukoumunne OC, Eldridge S, Chinn S, Campbell MJ. Patterns of intra-cluster correlation from primary care research to inform study design and analysis. Journal of Clinical Epidemiology. 2004;57(8):785–794. doi:10.1016/j.jclinepi.2003.12.013