Ask Mallard
Analysis method

Sample size for comparing three or more group means

5 min read

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

Before you start

What you need

Decide these first
  1. The number of independent groupsSupply groups as a whole count of at least three. The engine rounds the supplied value to the nearest integer.
  2. Cohen’s fSupply a positive f. It is the population SD of group means divided by the common within-group SD, with equal weights.
  3. 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.
  4. 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.
It rests on these
  1. 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.
  2. 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.
  3. 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.

The test model

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.

What the engine counts

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.

Match the planned analysis

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.

The method at a glance
Sample size for comparing three or more group means: Group count and Cohen’s f. Then Overall noncentral F power. Then Equal per-group count and total.Sample size for comparing three or more group meansGroup count and Cohen’s fOverall noncentral F powerEqual per-group count andtotalThis calculation sizes an overall equal-variance ANOVA with equal group sizes. It does not powerindividual pairwise contrasts, unequal group sizes, clustered observations or covariate-adjustedcomparisons.
Conceptual diagram. It shows the structure of the idea, not data from any study.

Worked example

A worked example

Invented for illustration
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

Searching PubMed…

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.

No Mallard code example points to this page.
Atlas node analysis.sample_size_anova, the id a plan cue records.

Related Learn pages

Related designs and methods

Evidence

Sources & further reading

  1. Non-normal data: Is ANOVA still a valid option? (opens in a new tab) · Psicothema · doi 10.7334/psicothema2016.383
  2. 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
  3. Statistical Power Analysis for the Behavioral Sciences, 2nd edition (opens in a new tab) · Lawrence Erlbaum Associates
Prepared with AI assistance. PubMed records checked on 2026-11-06 by title, authors, year and DOI: record verified, confirm it supports this use. No independent professional or methodological approval is claimed. The indexed sources discuss ANOVA assumptions and robustness, not the engine’s exact sample-size search. Cohen’s book defines the effect-size framework; it is not in PubMed.
Last source review: 2026-11-06
AI-generated educational content
Mallard uses reputable methodological and reporting sources, but this material may contain errors or omit important context. Verify important methodological decisions with the cited sources and, when appropriate, a qualified research methodologist or statistician.