Understanding the statistical power and sample size — concept and principle
Statistical power is the probability that a study detects an effect that really exists. A power analysis tells you how many participants each group needs before you collect data. This calculator covers the common case of comparing two independent group means with a two-sided t-test, where the effect is expressed as Cohen's d.
How it is calculated
- z values: z₁₋α/₂ is the standard normal quantile for the two-sided significance level (1.96 for α = 0.05); z₁₋β is the quantile for the target power (0.8416 for 80%).
- Sample size per group: n = 2(z₁₋α/₂ + z₁₋β)² ÷ d² + z₁₋α/₂² ÷ 4, rounded up. The last term is a small correction that brings the normal formula close to the exact t-test answer.
- Power for a given n per group: Power ≈ Φ(d√(n/2) − z₁₋α/₂), where Φ is the standard normal cumulative distribution.
d is unitless: the mean difference divided by the common standard deviation.
The principle
With n per group, the standard error of the difference between two means is σ√(2/n). Dividing the true difference by it gives the expected test statistic, d√(n/2). The test rejects when the statistic passes the critical value z₁₋α/₂, so power is the chance that a normal variable centred at d√(n/2) lands beyond that line (the tiny opposite tail is ignored). Setting this chance equal to the target and solving for n gives the sample-size formula. Because n depends on 1/d², halving the effect size roughly quadruples the required sample.
Worked example
- Inputs: d = 0.5, α = 0.05, target power 80%, n = 50 for the power check.
- z₁₋α/₂ = 1.95996, z₁₋β = 0.84162, sum 2.80158.
- 2 × (2.80158 ÷ 0.5)² = 62.79; correction 1.95996² ÷ 4 = 0.96; total 63.75, so n = 64 per group.
- Power with n = 50: 0.5 × √25 − 1.95996 = 0.54004, and Φ(0.54004) = 70.54%.
| Effect size d | n per group for target power |
|---|---|
| 0.125 | 1,006 |
| 0.25 | 253 |
| 0.375 | 113 |
| 0.5 | 64 |
| 0.625 | 42 |
| 0.75 | 29 |
| 1 | 17 |
How to read the result
80% power is the conventional minimum, meaning a 20% chance of missing a true effect; 90% is common in confirmatory trials (here it would need 86 per group). An exact noncentral-t calculation gives about 80.1% power for 64 per group and 69.7% for 50, so the approximation is close. The answer is per group: 64 means 128 participants in total, before allowing for dropouts.
Common mistakes
- Taking d from a small pilot study or a published effect that may be inflated.
- Forgetting to add extra participants for expected dropout or missing data.
- Computing "observed power" after a non-significant result; it adds nothing beyond the p-value.
Frequently asked questions
What effect size should I enter if I do not know it?
Use the smallest difference that would matter in practice, converted to d with a realistic SD. Cohen's 0.2, 0.5 and 0.8 are only rough benchmarks.
Is this valid for a one-sided test?
Replace α/2 with α, which is equivalent to entering twice your one-sided α in the α field.
Sources: Cohen, J. Statistical Power Analysis for the Behavioral Sciences, 2nd ed. (1988). · Guenther, W. C. (1981). The American Statistician, 35(4), 243–244.