Ask Mallard

Sample size and statistical power

Sample-size planning connects the scientific question, effect size or desired precision, outcome variability, error rates, and study design to the amount of data needed.

What question does this help answer?

“How much information is needed for this study to estimate the effect precisely enough or have a reasonable chance of detecting a scientifically important effect?”

Why it matters

A sample-size calculation is meaningful only after the primary objective, outcome, analysis, and clinically important effect or precision target are clear.

What power looks like

Two sampling distributions, one if there is no effect and one if the effect is real. A vertical line marks the critical value. The small tail of the no-effect curve beyond it is alpha, and the part of the real-effect curve beyond it is power.Power: how much of the alternative lies beyond the critical valuePowerAlpha: the small shaded tail beyond the critical valueEstimated differenceCritical valueIf there is no effectIf the effect is realA larger effect or a larger study pulls the two curves apart and raises power. An optimistic assumedeffect makes a study look more feasible than it is.
Conceptual diagram. It shows the structure of the idea, not data from any study.

How Mallard may use this concept

Mallard may recommend a power or precision calculation after it has specified the primary estimand, outcome type, comparison, and analysis. It should avoid generating a single sample-size number from vague assumptions.

When ordinary power is not the right answer

  • Precision: choose a confidence-interval width that is narrow enough to change a clinical or operational decision.
  • Fixed design: when the available dataset, time grid, clusters or eligible studies are fixed, report attainable precision or a prespecified minimum detectable effect rather than reverse-engineering a target sample.
  • Rule of thumb: events-per-variable or subjects-per-variable is a model-stability floor, not statistical power and not a final recommendation when a better effect- or precision-based method exists.
  • Bespoke simulation: use the complete data-generating and analysis models when clustering, repeated measures, mediation, recurrent events or another structure defeats the standard formulas.
  • Not applicable: an interval method, sensitivity analysis or presentation step is not sized on its own; size the primary scientific analysis it supports.

What a reproducible simulation reports

Prespecify the estimand, data-generating model, analysis model, nuisance parameters, missingness and fit-failure rules. Report the random seed, attempted replicates, successful fits, failed fits, estimated power and Monte Carlo standard error; a percentage with none of those is not a reproducible operating characteristic.

How the plan, Learn page and code stay connected

Each Mallard aim records its sizing approach, why that approach fits, the inputs still required and the next action. The generated R or Python code is selected from that same route in the public Mallard Code Library, so the plan cannot quietly point to a different calculation from the one its code runs.

Inputs commonly required

  • Primary outcome and effect measure
  • Clinically meaningful effect or target precision
  • Outcome prevalence, variance, or event rate
  • Type I error rate when hypothesis testing is used
  • Desired power
  • Allocation ratio
  • Attrition or missingness assumptions
  • Clustering, repeated measures, design effects, or number of events when applicable

What to watch out for

Using an optimistic effect size can make a study look artificially feasible. A nonsignificant result from a low-powered study is not evidence of no effect. A model-stability rule is only a floor, not power. A simulation without its seed, successful and failed fits, and Monte Carlo uncertainty is not reproducible. Conversely, a very large study can identify effects that are statistically precise but clinically trivial.

Clinical example

For an RCT with a binary primary outcome, estimate the required number of participants using the expected event rates in each arm, the target power, alpha, allocation ratio, and expected attrition.

Code for this method
Loading…
Recent studies that used this
Searching PubMed…
Part of the learning path Design a randomized trial (step 4 of 7).
Work it out
Related Learn pages
Sources & further reading
  1. Sample Size Considerations: Basics for Preparing Clinical or Basic Research (opens in a new tab) · Ann Nucl Cardiol · doi 10.17996/anc.20-00122
  2. Statistical primer: sample size and power calculations-why, when and how? (opens in a new tab) · Eur J Cardiothorac Surg · doi 10.1093/ejcts/ezy169
Last source review: 2026-09-05
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.