The short answer: Sample size is driven by the precision you need and the effect you want to detect. For a margin of error E on a mean, n = (zσ/E)². For a difference between two groups, n grows with the square of the standardized effect you need to detect. Clustering, nonresponse, and subgroup analyses all push the required number higher.

Key takeaways

  • Two different targets: a margin-of-error calculation answers “how precise?”, a power calculation answers “what can I detect?”
  • Sample size has diminishing returns. Quadrupling n halves the margin of error, at four times the cost.
  • Power is usually set at 80% or 90%. Lower power means a real effect is likely to be missed.
  • Design effects multiply the required n. Clustered samples can need two or three times as many observations as a simple random sample.
  • Bigger samples do not fix bias. A biased design stays biased at any size.

What sample size buys — and what it does not

A larger sample buys precision and power. Precision is the width of the confidence interval around your estimate; power is the chance of detecting an effect of a given size if it exists. Both improve with n, but neither fixes a sample that is unrepresentative, a questionnaire that measures the wrong thing, or a design that confuses correlation with causation.

This is why sample size planning starts with the question, not the formula. Are you estimating a population mean, comparing two groups, measuring a proportion, or testing several subgroups? Each target has its own calculation, and the largest required n usually governs the design.

Sample size for a mean

Rearranging the margin-of-error formula E = zσ/√n gives:

n = (z × σ ÷ E)²

Suppose the population standard deviation is thought to be 15 points and you want a 95% margin of error of 2 points. Then n = (1.96 × 15 ÷ 2)² = (14.7)² = 216.09, which rounds up to 217. Always round up: 216 would give a margin slightly larger than requested.

If the population is finite, apply the correction nadj = n ÷ (1 + (n − 1)/N). With N = 2,000, the adjusted size is 217 ÷ (1 + 216/2,000) = 217 ÷ 1.108 = 195.9, so 196 observations suffice. The correction matters when the sample is a substantial fraction of the population, roughly above 5%.

Sample size for a proportion

For a proportion with margin of error E, the formula is:

n = z² × p(1 − p) ÷ E²

When p is unknown, use p = 0.5, which maximizes p(1 − p) and therefore gives the most conservative sample. For a 95% margin of error of 3 percentage points, n = 3.8416 × 0.25 ÷ 0.0009 = 1,067.1, which rounds up to 1,068. If prior evidence suggests p is near 0.2, the required size drops to 3.8416 × 0.16 ÷ 0.0009 = 683.

The same finite-population correction applies. For N = 20,000, the 1,068 becomes 1,068 ÷ (1 + 1,067/20,000) = 1,014. For a population of a few hundred, the correction can cut the sample dramatically, which is why a census of a small organization is often feasible.

Power and effect size

Power is the probability of rejecting the null when the alternative is true. The conventional target is 80%, meaning a 20% chance of a false negative, though 90% is common in clinical trials. For a two-group comparison of means, a standard approximation is:

n per group ≈ 2 × (z1−α/2 + z1−β)² ÷ δ²

Here δ is the effect size in standard deviation units. With α = 0.05 and 80% power, the numerator is 2 × (1.96 + 0.842)² = 15.70. A moderate effect of δ = 0.5 needs 15.70 ÷ 0.25 = 63 per group; a small effect of δ = 0.2 needs 15.70 ÷ 0.04 = 393 per group; a large effect of δ = 0.8 needs only 25 per group.

The lesson is that small effects are expensive. Halving the effect size quadruples the sample, and that is before attrition or clustering. Power calculations should use the smallest effect that would be practically meaningful, not the largest effect you hope to see.

Design effect and clustered samples

Observations in a cluster — students in a classroom, patients in a clinic, residents in a neighborhood — are usually more similar than observations drawn independently. That similarity reduces the effective information in each observation. The design effect is:

DEFF = 1 + (m − 1) × ρ

where m is the cluster size and ρ is the intraclass correlation. With m = 30 and ρ = 0.05, DEFF = 1 + 29 × 0.05 = 2.45. To obtain the precision of 400 independent observations, you need about 400 × 2.45 = 980 observations in clusters. The effective sample size is n ÷ DEFF, not n.

Survey weights create a second design effect, because unequal weighting reduces effective sample size even without clustering. Software that reports a “design effect” usually combines both. If you ignore them, the reported margin of error will be too small and the study will look more precise than it is.

Finite populations and response rates

The finite-population correction reduces n when the sample is a large share of the population, but it does not excuse nonresponse. If you need 400 completed interviews and expect a 60% response rate, invite at least 400 ÷ 0.60 = 667 people. If response differs systematically between those who answer and those who do not, the resulting bias is not repaired by a larger invitation list.

Attrition works the same way in longitudinal studies. A study that needs 500 participants at the final wave and expects 20% dropout should enroll about 625. Plan the inflation before data collection and track response by subgroup so that differential nonresponse is visible.

Subgroups, rare outcomes, and multiple comparisons

An overall sample can be adequate for the main estimate and useless for subgroup comparisons. If four subgroups each need 400 observations for the same precision, the total is 1,600 unless the design oversamples. Interaction tests need even more, because the effect being tested is a difference between differences.

Rare outcomes need larger samples because the effective information depends on the number of events, not just the number of people. A study of a 1% event rate with 1,000 participants observes about 10 events, which is far too few for stable modeling. Multiple outcomes and multiple comparisons also raise the required evidence, since each additional test increases the chance of a false positive.

Which numbers to plug in

Use a standard deviation from prior studies, a pilot, or a conservative assumption, and state the source. For proportions, use the most conservative plausible value unless you have good evidence for a different one. For power, specify the smallest effect that would change a decision, not the effect you expect to observe.

Be wary of plugging in an effect size estimated from a small pilot: such estimates are noisy and often inflated, which makes the planned sample too small. It is usually better to power the study for a smaller effect than the pilot suggests, or to use a design that is robust to uncertainty in the effect size.

Common mistakes

  • Rounding down instead of up, which quietly misses the target margin of error.
  • Using the finite-population correction when the sample is a tiny fraction of the population.
  • Powering a study for the effect you hope to find rather than the smallest effect that matters.
  • Ignoring clustering or weighting, which makes the effective sample much smaller than the raw count.
  • Forgetting to inflate for nonresponse, dropout, or unusable records.
  • Calculating power after the study and calling an underpowered result “negative.”

Practical caveats

Sample size is a budget decision as much as a statistical one. Doubling the sample often doubles the cost while only improving precision by about 41%, so the right size balances the value of precision against the cost of data collection. A smaller, well-measured, representative sample can beat a larger, biased one.

Finally, register or document the sample-size rationale before data collection. A planned sample protects against the temptation to stop when the result looks significant, and it makes the study’s precision claims auditable. Underpowered studies are not just inefficient; they waste participants’ time and can produce misleading literatures.

Frequently asked questions

What is statistical power?

Power is the probability of detecting an effect of a specified size when that effect is real. It equals 1 minus the false-negative rate, and 80% is a common minimum target.

How do I choose the margin of error?

Choose the largest margin that still supports the decision you need to make. A political poll may tolerate ±3 points; a clinical measurement may need much finer precision.

Does a larger sample always mean better results?

No. A larger sample improves precision and power, but it cannot fix selection bias, measurement error, or a confounded design. Representativeness matters as much as size.

What is a design effect?

It is the ratio of the variance under a complex design to the variance of a simple random sample of the same size. Clustering and unequal weighting typically push it above 1, increasing the sample you need.

Can I use a sample size formula for a proportion when p is unknown?

Yes. Use p = 0.5 for the most conservative estimate, or a plausible value from prior data if you have it. Report the assumption so readers can judge the precision claim.

Why do I need more participants than my calculation says?

Because the calculation usually assumes complete data and simple random sampling. Inflate for nonresponse, attrition, unusable responses, and design effects before you start recruiting.

Further reading

Keep exploring

Read next Logarithm: Base, Product Rule, and Scale A logarithm is an exponent in disguise. Learn the definition, the product, quotient and power rules, change of… Read next Order of Operations: PEMDAS and Ambiguous Expressions PEMDAS is a shared convention, not a law of mathematics. Learn the real precedence rules, the exponent and… Read next Significant Figures: Counting, Rounding, and Precision Significant figures record how precisely a value was measured. Learn the counting rules, the addition and multiplication rules,…