Power Analysis Calculator
Statistical power is the probability your study will actually detect a real effect of a given size. Pick a design, supply three of the four key inputs (effect, alpha, power, n), and the calculator solves for the fourth, from sample-size planning to minimum detectable effect. Everything runs in your browser.
i New to power analysis? Read the 4-min primer
What power is. Statistical power is the probability of detecting a real effect of a given size at a chosen alpha. Power = 0.80 means that if the effect you are positing actually exists, you have an 80% chance of getting a significant result, and a 20% chance of missing it (a Type II error). Pick the design first, then ask what power you can afford.
The four-way relationship. Sample size n, effect size, alpha, and power form a closed system: pin three, the fourth is forced. Bigger effects need fewer subjects. Tighter alpha (0.01 vs 0.05) costs sample size. Higher power (0.90 vs 0.80) costs sample size. Smaller effects cost the most: halving d roughly quadruples n.
How to read the result. If you solved for n, the number you get is the smallest sample that reaches the target power. If you solved for power, you get the probability of detecting the effect at the n you can collect. If you solved for the minimum detectable effect, the number is the smallest effect you have a chance of catching given your n, alpha, and target power.
Picking the design. Continuous outcome, two groups: two-sample t-test on Cohen's d. Continuous outcome, paired or single-arm: one-sample or paired t. Binary outcome, two arms: two-proportion test on Cohen's h. Multi-arm continuous: one-way ANOVA on Cohen's f. Bivariate Pearson correlation: correlation power on r. Goodness-of-fit or contingency: chi-square on Cohen's w with correct df.
When to use this design
-
How this is computed
✓ No data leaves your browser
✓ Verified against R's pwr.t.test(), pwr.anova.test(), pwr.r.test() and friends
✓ Free, no sign-up
Anatomy of a power calculation
pt(t, df, ncp), so one- and two-sided power match pwr.t.test() to machine precision.pwr.anova.test().pwr.2p.test and pwr.p.test. It gets brittle when expected counts are tiny; switch to an exact test there.pwr.r.test() uses: apply the variance-stabilising Fisher z transform to the target r (with the small r / (2(n-1)) bias correction), transform the critical correlation the same way, and read power off a standard normal whose SE is 1 / sqrt(n-3). This matches pwr.r.test() to machine precision.When this is the wrong tool
These closed-form formulas assume a single fixed effect with a known sampling distribution. If your design breaks that assumption, reach for the alternative.
| If you have | Use instead |
|---|---|
| Clustered or hierarchical data (students in classes, patients in clinics) | The independence assumption fails. Inflate n by the design effect 1 + (m-1)ρ (m = cluster size, rho = intraclass correlation), or simulate against the mixed model you plan to fit. |
| Time-to-event / survival outcome | The number of events drives power, not the number of patients. Use Schoenfeld's formula on the log hazard ratio, or simulate against a Cox model with realistic censoring. |
| Bayesian a priori sample size | Frequentist power asks for a long-run rejection rate. A Bayesian sample-size question (posterior precision, Bayes-factor design) is a different paradigm; simulate against your prior and likelihood. |
| Pilot-study sample size | Pilots are sized for feasibility (recruitment, dropout, instrument validity), not hypothesis power. Cohen's tables do not apply; aim for about 12 per arm or follow a feasibility guide. |
| Mixed effects, GLMM, nested ANOVA | No closed form. Simulate: generate datasets under H1, fit the model, count rejections. |
Frequently asked questions
How do I calculate the power of a t-test?
Power = 1 - beta, the probability of detecting a true effect. For a two-sample t-test, power depends on effect size (Cohen's d), sample size per group, and alpha. A standard target is 0.80. The calculator inverts the relationship: given any three of {n, d, alpha, power}, it solves for the fourth, same as R's pwr::pwr.t.test.
What is the minimum detectable effect (MDE)?
MDE is the smallest true effect size your study would detect with the desired power and alpha at a given sample size. If your MDE is 0.5 SD but you only care about effects above 0.2 SD, your study is underpowered and a non-significant result is uninformative. Always compute MDE before running an experiment.
Why does my study need so many subjects to detect a small effect?
Required sample size grows with the inverse square of the effect size. Halving the effect quadruples n. To detect Cohen's d = 0.2 (small) at 80% power needs about 200 per group; d = 0.5 (medium) needs 64; d = 0.8 (large) needs only 26. Run the math first to confirm the study is feasible.
Go deeper
Numerical methods: exact noncentral t via the AS 243 series (the routine behind R's pt); noncentral F and chi-square via the exact Poisson-mixture CDF series; correlation via the Fisher-z route of pwr.r.test; proportions via Cohen's h and the arcsine normal approximation. Verified against R 4.6.0's pwr package to better than 1e-6.