TL;DR
Power is the probability your study will detect a real effect of a given size. Sample size, effect size, variability, and significance level are all linked: fix any three and the fourth follows. Calculate the n you need before you run the experiment, aiming for ~80% power (often higher for confirmatory work). Post-hoc "observed power" is not meaningful.
The four interlocking pieces
A power analysis ties together:
- Effect size: the smallest difference you'd care to detect (your "minimum biologically meaningful effect"). You supply this; it's a scientific judgment, not a statistical one.
- Variability: the standard deviation of your measurements (from pilot data or prior literature).
- Significance level (α): usually 0.05.
- Power (1 − β): usually targeted at 0.80, meaning an 80% chance of detecting the effect if it's real. Confirmatory or expensive studies often aim for 0.90+.
Give any three and the calculation returns the fourth. Most often you fix effect size, variability, α, and power, and solve for sample size.
Why it matters
- Underpowered studies are the dominant problem in biology. With too few samples you'll often miss real effects (Type II error), and the "significant" results you do find tend to be exaggerated and less reproducible.
- Overpowered studies waste animals, reagents, and time, and can flag trivial differences as "significant."
- Reviewers and ethics/animal-use committees increasingly require a sample-size justification in the methods.
Don't compute "observed" power after the study using the effect you happened to see; it's circular and just restates the p-value. For a non-significant result, report the confidence interval instead.
How to run it
You need an estimate of the effect size and variability, whether from a pilot, a previous paper, or a defensible assumption. Then:
- R: the
pwrpackage, e.g.,pwr.t.test(d = 0.8, sig.level = 0.05, power = 0.8)returns n per group for a two-sample t-test.power.t.test()is built in. For complex designs, simulate. - G*Power: free, point-and-click, supports t-tests, ANOVA, regression, chi-square, and correlations; the most widely used tool for this.
- Python:
statsmodels.stats.power(e.g.,TTestIndPower().solve_power(...)).
For designs more complex than a t-test or simple ANOVA (mixed models, nested designs, survival), simulation-based power is the honest approach, and a good moment to involve a statistician.
Adjust the effect size and significance level to see how the sample size needed for 80% power shifts:
You need n ≈ 25 per group for 80% power at d = 0.80, α = 0.05. Larger effects need far fewer samples; the curve climbs then flattens.
A biology example
You expect a treatment to raise expression by about 1 standardized unit (Cohen's d ≈ 1.0), with α = 0.05 and target power 0.80. pwr.t.test(d = 1.0, power = 0.8, sig.level = 0.05) returns roughly 17 per group. If you only expect d ≈ 0.5, you'd need ~64 per group: small effects cost a lot of samples. This is the calculation to run before committing animals or a sequencing budget.
Common mistakes
- Post-hoc / "observed" power. Computing power after the study using the effect size you observed is circular and uninformative; it's just a restatement of the p-value. If a result is non-significant, report the confidence interval instead → effect size and confidence intervals.
- Optional stopping. Adding samples until p < 0.05 inflates false positives. Fix n in advance (or use a proper sequential design) → p-values.
- Counting the wrong thing as n. Three wells from one culture are not n = 3 independent samples → replicates and pseudoreplication.
- Guessing effect size to hit a convenient n. Base it on what's biologically meaningful or on real pilot data, not on the sample size you can afford.
- Ignoring expected dropout/attrition in animal or longitudinal studies. Inflate n to compensate.
Related
P-values · Effect size and confidence intervals · Replicates and pseudoreplication