Test
Effect to detect

What this calculator does

Before you collect data it is worth asking how much of it you actually need. Too little and a real effect slips past unnoticed; too much and you have spent time and money you did not have to. This calculator answers the question for the two most common F tests: given the effect you want to be able to detect, the significance level you will use, and the power you want, what is the smallest sample size that gets you there?

The two tests

Linear regression — the entire model

Powers the F test that asks whether your regression model as a whole explains significantly more than the mean alone — H0: Y = b0. The numerator degrees of freedom are the number of predictors p, the denominator n − p − 1. Note this powers the model, not any single coefficient: a model can be significant overall while an individual predictor is not.

One-way ANOVA

Powers the F test comparing k group means. The numerator degrees of freedom are k − 1 and the denominator n − k, where n is the total sample across all groups. Because the search is over the total, the answer need not divide evenly by k — so the results table also gives the per-group count a balanced design needs, and the slightly larger total that implies.

How to use the calculator

  1. Test — linear regression or one-way ANOVA.
  2. Significance level (α) — a p-value below this counts as statistically significant. Researchers usually use 0.05, but where a mistake is expensive they may use 0.01.
  3. Target power — the power you want the test to have. Conventionally 0.8.
  4. Predictors (p) / Groups (k) — the number of independent variables in the regression, or the number of groups in the ANOVA. The field relabels itself when you change the test.
  5. Effect — if you do not know the effect size you want, pick Small, Medium or Large and the calculator fills in Cohen's conventional value on the f scale. Regression: 0.14 / 0.39 / 0.59. ANOVA: 0.1 / 0.25 / 0.4.
  6. Effect type and Effect size — enter the effect on whichever scale you have it: Cohen's f, f², or R² (η² for ANOVA). They are interchangeable, and the results table shows all three whichever you choose.
  7. Digits — how many digits the results are rounded to for display. It does not change the calculation.

Effect sizes, and how they convert

All three scales describe the same thing. f² is what the noncentrality is built from, and R² (or η²) is the proportion of variance the model explains:

FromTo f²To R² / η²
Cohen's ff² = f ²R² = f² / (1 + f²)
R² / η²f² = R² / (1 − R²)—

Regression example. A linear regression with 4 predictors at α = 0.05 and power 0.8: a sample of 85 will detect a model with R² = 0.13 (equivalently f² = 0.1494, f = 0.3866). A model with a smaller R² than that would be detected with power below 0.8.

ANOVA example. A one-way ANOVA with 3 groups at α = 0.05 and power 0.8, medium effect (f = 0.25): a total sample of 158 achieves a power of 0.8022. For equal groups that becomes 53 per group, i.e. 159 in total.

How to read the power curve

The curve shows the power the test would have at every sample size, so you can see the shape of the trade-off rather than just one number. The dashed amber line is your target power, and the marked point is the smallest sample that reaches it. Hover anywhere on the curve (or drag a finger across it on a phone) to read the sample size and the power at that point.

The curve is usually steep at first and then flattens. That flattening is the important part: past a certain size each extra observation buys very little power, and it is often cheaper to target a slightly larger effect than to keep recruiting.

Green's rules of thumb

For multiple regression, two widely quoted shortcuts (Green, 1991) are n = 50 + 8p for testing the whole model and n = 104 + p for testing individual coefficients. They are quick, and they are shown in their own table beside the computed answer — but they assume a medium effect and contain no α and no target power at all. So they can be generous for a large effect and badly short for a small one. The third row of that table is the part the rule itself cannot tell you: the power n = 50 + 8p actually achieves against your effect.

If the sample size is too large to be practical

You have four levers, and it is worth knowing what each one costs you:

  • Accept a lower power. Honest, and cheap — but you are accepting a bigger chance of missing a real effect.
  • Raise α. Also cheap, and also a real cost: more false positives.
  • Target a larger effect. Much the strongest lever, because the required sample falls roughly with the square of the effect. Only defensible if the smaller effect genuinely would not matter to you.
  • Use fewer predictors (or fewer groups). Fewer numerator degrees of freedom means a smaller required sample — but drop a predictor for a substantive reason, not to make the number look better.

What you should not do is run the study at the smaller size anyway and hope. An underpowered study that finds nothing has not shown there is nothing there.

Related calculators