Sample size for comparing three or more group means
Size equal independent groups for an overall difference in means, using Cohen’s f and the noncentral F distribution.
Fit
When to use it, and when not to
Use it when
- You will compare means across three or more independent groups with a classic one-way ANOVA.
- Equal group sizes and a common population variance fit the study.
Not when
- You have two independent groups. Size a two-mean comparison. Read: Sample size for comparing two means
- The main question is a particular pairwise contrast. Size that contrast and plan multiplicity control. Read: Multiple testing and multiplicity
- The same people appear in several groups or visits. Plan power for the repeated-measures model. Read: Choosing an approach for repeated measures
Before you start
What you need
- The number of independent groupsSupply groups as a whole count of at least three. The engine rounds the supplied value to the nearest integer.
- Cohen’s fSupply a positive f. It is the population SD of group means divided by the common within-group SD, with equal weights.
- The significance level for the overall F testAlpha is the chance of rejecting a true null under the model. Supply a probability between zero and one.
- The target powerPower is the chance of rejecting the null at the assumed effect. The engine limits this input to 0.5 through 0.999.
- The units counted in the sample size are independent.How to check: Check for shared clinics, families or repeated observations before using an individual-level calculation.
- The effect and spread are defensible planning values.How to check: Use prior data and clinical judgment. Repeat the calculation with smaller effects and larger spreads.
- Groups have equal sizes and normal errors with a common population variance.How to check: Check planned allocation and expected group spreads. The engine has no unequal-allocation ANOVA input.
Plain language
How it works
ANOVA means analysis of variance. Cohen’s f describes how far the group means spread around their grand mean, relative to the common within-group SD.
For K groups and N people total, the engine uses upper-tail noncentral F power. Its degrees of freedom are K minus one and N minus K. Noncentrality is N times f squared.
It searches whole per-group sizes from two upward. Power at a supplied total uses the whole-number count per group, rounded down, with a minimum of two.
Choosing a sample-size method helps distinguish overall group differences from a single contrast. A significant overall test does not identify which group means differ.
Worked example
A worked example
- Setting
- A trial plans equal-sized groups for a continuous outcome.
- Question
- How many people are needed for the overall ANOVA test?
- Approach
- Use groups = 3; f = 0.25; alpha = 0.05; power = 0.8. The effect describes the pattern of group means.
- Result
- The engine returns 53 per group across 3 groups: 159 people total. Power at that total is 80.49%.
- What it means
- This powers the overall test that not all means are equal. It does not guarantee power for any particular pair or adjust follow-up tests.
In practice
Recent studies PubMed search · not vetted
Watch out
Common mistakes
The one to remember
This calculation sizes an overall equal-variance ANOVA with equal group sizes. It does not power individual pairwise contrasts, unequal group sizes, clustered observations or covariate-adjusted comparisons.
- Entering a two-group standardized mean difference as Cohen’s f.Instead: Justify f from the full pattern of means and common within-group spread.
- Calling overall ANOVA power the power of every pairwise comparison.Instead: Specify the primary contrast and multiplicity plan before sizing follow-up tests.
Inside Mallard
How Mallard uses this
For one-way ANOVA, Mallard returns an equal per-group count, group count, total and power at a supplied total rounded down to equal whole groups.
analysis.sample_size_anova, the id a plan cue records.Related Learn pages
Related designs and methods
Evidence
Sources & further reading
- Non-normal data: Is ANOVA still a valid option? (opens in a new tab) · Psicothema · doi 10.7334/psicothema2016.383
- Effect of variance ratio on ANOVA robustness: Might 1.5 be the limit? (opens in a new tab) · Behav Res Methods · doi 10.3758/s13428-017-0918-2
- Statistical Power Analysis for the Behavioral Sciences, 2nd edition (opens in a new tab) · Lawrence Erlbaum Associates