Calculates on this device. File exports run online.
Statistical Power Calculator
Choose the test you will run. Type the effect you want to find, the significance level and the power to get the sample size, or the sample size to get the power or the smallest effect it can find. Non-inferiority, equivalence and survival (log-rank) designs, case-control and cohort studies and cluster randomised trials are covered too.
Enter your values
Check these values
Your values are worked out in this browser. They are not sent to a server.
Your result will show here
Fill in the values, then choose Calculate.
Your result
How it was worked out
How to use the calculator
- Choose the test: comparing means (t test), several means (ANOVA), a correlation, two proportions (also from an odds ratio or a relative risk), a chi-square test, a non-inferiority or equivalence trial, or a survival comparison by the log-rank test.
- Choose what you want to find: the sample size, the power or the smallest effect.
- Type the effect size, the significance level (often 5%) and the power (often 80%), and press Calculate.
- The box under the result answers the same question with statsmodels, with a power curve and tables of other sizes.
Effect sizes
- Cohen's d (t tests): the difference in means ÷ the standard deviation. 0.2 small, 0.5 medium, 0.8 large.
- Cohen's f (ANOVA): 0.10 small, 0.25 medium, 0.40 large. r (correlation): 0.1, 0.3, 0.5. w (chi-square): 0.1, 0.3, 0.5.
- These words are Cohen's (1988) conventions; the effect that matters in your field is a better guide.
Non-inferiority, equivalence and survival
- Non-inferiority: show that a new treatment is not worse than the control by more than a margin δ. For proportions, n per group = (z_{1−α} + z_{1−β})² (p1 q1 + p2 q2) ÷ (p2 − p1 + δ)² (Chow, Shao and Wang 2008). Both at 80% with a 10-point margin, 2.5% one-sided and 80% power: 252 per group.
- Equivalence: two one-sided tests, each at α; the power counts both. For means the power is worked out with the t distribution (Phillips 1990).
- Survival: the log-rank test needs a number of events: Schoenfeld (1983) d = (z_α + z_β)² ÷ (p (1 − p) (ln HR)²); Freedman (1982) d = (z_α + z_β)² (1 + HR)² ÷ (1 − HR)² for equal groups. For a hazard ratio of 0.7 (5% two-sided, 80% power): 247 events by Schoenfeld, 253 by Freedman; for 0.5: 66 and 71. The number of patients follows from the share who have an event during accrual and follow-up.
Worked example
To find a medium effect (d = 0.5) between two groups with a two-sided test at 5% and 80% power, you need 64 people per group (128 in all); their power is 80.1%.
A one-way ANOVA of three groups with f = 0.25 needs 53 per group (159 in all); a correlation of 0.3 needs 85 pairs.
Limits you should know
- Power after the study ("post hoc", from the effect you observed) adds nothing to the p-value: plan the power before you collect data.
- The formulas assume independent observations and the usual test conditions (normal data for t and F tests).