Toolvito

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

Your values

The difference ÷ the standard deviation. Cohen's conventions: 0.2 small, 0.5 medium, 0.8 large.

The chance of a false positive you accept, often 5%.

The chance of finding the effect if it is there, often 80% or 90%.

More options

For unequal groups; 1 for equal groups.

For a cluster randomised trial (schools, clinics, villages): with the ICC, gives the design effect.

From earlier studies of the same outcome in similar clusters.

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.

Independent check with a power curve

Independent check with a power curve

Uses the test and the numbers of the result above. The server answers the same question with statsmodels and its own code (a different program), and adds a power curve, tables of other sizes and, if you type them, a design effect and a response rate. For non-inferiority, equivalence and survival designs it also simulates 2,000 trials with a fixed seed to check the power.

The calculator above works on your device. When you run a task in this section, Toolvito receives the values and result you submit to make the file or run the check. Download the result within one hour after the job finishes. Choose Delete files now to request earlier removal. The hourly cleanup normally removes files within one to two hours after completion.

How to use the calculator

  1. 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.
  2. Choose what you want to find: the sample size, the power or the smallest effect.
  3. Type the effect size, the significance level (often 5%) and the power (often 80%), and press Calculate.
  4. 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).

Related tools