Design, replicates and sample size · Choose a method

Sample size for more than two groups: power the comparison you will actually report

For three or more groups, base the sample size on the comparisons you will report, such as each dose against control with an adjusted α, not the overall ANOVA. The resource equation suits exploratory studies. Python and R code.

By Licklider · Published · Last reviewed · How this page was made · Markdown

On this page
  1. Which calculation for your planned analysis
  2. Worked example: vehicle and three doses
  3. Choosing the inputs
  4. Check what an AI assistant ran
  5. Report it
  6. References

Quick answer. With three or more groups, decide first which comparisons you will report, then calculate the sample size for those. If you will compare each dose with control (Dunnett’s test), use a two-group calculation for the smallest difference that matters, at α divided by the number of dose-versus-control comparisons (for three doses, 0.05/3, a slightly conservative stand-in for Dunnett). If your question is a steady change with dose, power the trend test, which needs fewer animals. A calculation for the overall ANOVA F-test (Cohen’s f) answers “do the groups differ at all?”, which is rarely the result you will report. The resource equation (10 to 20 error degrees of freedom) is for exploratory studies without an estimate of variability; with four groups it gives 4 to 6 animals per group, which in our example gave 8.9% to 14.7% power for the planned 10-unit comparison (20.3% to 35.1% even for the 15-unit difference).

Terms used below. Vehicle: the control group given the solvent without the compound. Power: the chance of detecting an effect that is really there; 80% is a common target. α: the false-positive rate per test, usually 0.05. Adjusted α: a stricter threshold used when several comparisons are made, for example 0.05 divided by their number (Bonferroni). Dunnett’s test: compares each group with one control and adjusts for the several comparisons. Omnibus F-test: the overall ANOVA test of whether any group means differ. Cohen’s f: the spread of the group means divided by the within-group SD, the effect size for the omnibus F-test. SD: standard deviation within groups. Cohen’s d: a difference between two means divided by the SD. Linear trend contrast: one test for a steady change across ordered groups. Error degrees of freedom: the number of animals minus the number of groups. Resource equation: a rule of thumb that sets the error degrees of freedom between 10 and 20. Experimental unit: the animal, or the cage if the whole cage is treated. Tukey’s test: a test that compares every pair of groups; with g groups there are g(g − 1)/2 pairs (6 for four groups). Two-sided: a test that counts differences in either direction. Exploratory study: one without a pre-specified comparison to test. Familywise α: the chance of at least one false positive across all the planned comparisons. Noncentrality: how far the expected test statistic lies from zero, which sets power. Welch’s t-test: a two-group test that allows unequal SDs. Holm adjustment: a stepwise correction for several p-values, less strict than Bonferroni. Confirmatory study: one designed to test a comparison stated in advance. Contrast weights −3, −1, 1, 3: equally spaced dose scores 0 to 3, centred and doubled to whole numbers (test for trend).

Which calculation for your planned analysis

Planned analysis Effect size to enter Calculation α
Each treatment vs one control (Dunnett) Smallest difference that matters, divided by the SD (Cohen’s d) Two-group t-test calculation, per group 0.05 / number of comparisons (slightly conservative)
All pairwise comparisons (Tukey) Smallest pairwise difference that matters Two-group calculation 0.05 / number of pairs (conservative)
A steady change with dose The expected trend (contrast), with weights matching your dose scores (equal steps unless planned otherwise) Contrast power, or a regression on dose 0.05
Only “do any groups differ?” Cohen’s f from the expected means pwr.anova.test (R) or FTestAnovaPower (Python) 0.05
No estimate of the SD; exploratory study None Resource equation: error df 10 to 20 Not a power calculation

The NC3Rs Experimental Design Assistant puts the principle plainly: “A power analysis is specific to the statistical test which will be used to analyse the data” (NC3Rs EDA). ARRIVE 2.0 asks you to “explain how the sample size was decided” and notes that significance thresholds “will need to be adjusted in scenarios of multiple testing (e.g. by using a Bonferroni correction)” (ARRIVE 2.0, item 2b). Mayer and colleagues describe the cost to animal research: “smaller type 1 error rates per hypothesis would raise the required sample size” (Mayer et al. 2022); they argue for designs that avoid blanket Bonferroni adjustment, such as testing comparisons in a fixed order, which is another reason to plan only the comparisons you need.

Worked example: vehicle and three doses

Assumed values: you expect the marker to fall from 100 (vehicle) to 95, 90 and 85 with the three doses, with an SD of 12 within groups, and you plan to compare each dose with vehicle by Dunnett’s test. The smallest difference you care about is 10 units (the mid-dose difference from vehicle). Stored code: analysis.py, analysis.R and the output; analysis.py and analysis.R print the same output.

Calculation (80% power; means 100, 95, 90, 85, SD 12, equal group sizes) n per group Total (4 groups)
Omnibus ANOVA F-test (Cohen’s f = 0.466); answers only “do any groups differ?” 14 56
Linear trend contrast (weights −3, −1, 1, 3; equal dose steps) 10 40
Dose vs vehicle, difference 15, α = 0.05 11 44
Dose vs vehicle, difference 15, α = 0.05/3 15 60
Dose vs vehicle, difference 10, α = 0.05 24 96
Dose vs vehicle, difference 10, α = 0.05/3 (the planned comparison) 31 (32 with a two-group calculator) 124 (128 at 32)
Dose vs vehicle, difference 5 (the low dose; below the smallest difference that matters, so not powered) 122 488
Resource equation (rule: 10 to 20 error df; 12 to 20 with whole groups of 4 to 6); not a power calculation 4 to 6 16 to 24

For the questions considered here, the same design gives 4 to 31 animals per group, depending on the question. The omnibus calculation (14) would leave the planned mid-dose comparison underpowered; the trend contrast (10) is the efficient choice only if a steady change with dose is the question you decided in advance (test for trend). With the resource equation’s 4 to 6 per group, power for the planned comparison was 8.9% to 14.7% for the 10-unit difference and 20.3% to 35.1% for the 15-unit difference. The low dose’s 5-unit difference is below the smallest difference that matters here, so that comparison is not powered; report it as supporting information. The trend contrast’s power uses the noncentrality (Σ cᵢμᵢ) / (SD × √(Σ cᵢ² / n)), computed in analysis.py and analysis.R.

Is 0.05/3 too strict for Dunnett’s test? We checked by simulation (10,000 experiments per row; simulation.py, the simulation output): with 15 per group, Dunnett’s test detected the 15-unit difference in 84.3% of experiments, and with 31 per group it detected the 10-unit difference in 81.8%, a little above the 80% the Bonferroni calculation aimed for in both cases, so the shortcut errs on the safe side.

from statsmodels.stats.power import FTestAnovaPower, TTestIndPower

# Omnibus F-test: statsmodels returns the TOTAL number of animals across groups
nobs = FTestAnovaPower().solve_power(effect_size=0.466, alpha=0.05, power=0.80, k_groups=4)
print(nobs, nobs / 4)                                # 54.3 in total, 13.6 per group -> 14
# Planned comparison: each dose vs vehicle, smallest difference 10, SD 12, three comparisons
print(TTestIndPower().solve_power(effect_size=10 / 12, alpha=0.05 / 3, power=0.80))   # 31.6 per group -> 32
library(pwr)
pwr.anova.test(k = 4, f = 0.466, sig.level = 0.05, power = 0.80)   # n per group: 13.6 -> 14
pwr.t.test(d = 10 / 12, sig.level = 0.05 / 3, power = 0.80)         # n per group: 31.6 -> 32

The two-group calculators give 32 rather than 31 because they assume only two groups contribute to the error variance; with all four groups in one ANOVA there are more error degrees of freedom. Either is defensible; say which you used. In G*Power the planned comparison is “t tests → Means: Difference between two independent means (two groups)” with effect size d = 10/12 and α = 0.05/3; for a calculator without code, see our sample size calculator.

Choosing the inputs

These calculations assume a roughly normal outcome with similar SDs in all groups. If you expect the SDs to differ, plan Welch’s t-tests against control with a Holm adjustment (which correction to use) and use the largest expected SD.

  1. The difference. Use the smallest difference that would matter biologically, from a pilot, published data or the size of effect that would change your next step; say which.
  2. The SD. Take it from a pilot or a similar published study with the same strain, age and measurement, and say where it came from. A wrong SD changes n more than the choice of software. With no SD source at all, a confirmatory study cannot be powered: run a pilot first, or treat the study as exploratory.
  3. Avoid “medium effect” conventions. Cohen’s benchmarks (f = 0.10, 0.25, 0.40) come from the social sciences; NC3Rs notes that for laboratory animals effects are “generally accepted” to be larger than Cohen’s d benchmarks suggest (NC3Rs EDA). Use your own difference and SD instead.
  4. The experimental unit. If treatment is given per cage, the sample size is the number of cages (what counts as n).
  5. More animals in the control group. With several treatments compared with one control, NC3Rs notes that sensitivity can be increased “by putting more animals in the control group”. The numbers above assume equal group sizes.
  6. Losses. Divide by the share expected to complete the study: with 10% losses, 31 ÷ 0.9 = 34.4, so 35 per group. Say how many and why.
  7. If n is more than you can use, change the design rather than the calculation: drop a dose, plan a trend test if a steady change is the real question, use a less variable outcome or measure, or accept a larger smallest difference and say so. Running the study underpowered and reading a non-significant result as “no effect” is the costly option (not significant: what it means).

Festing and Altman describe the resource equation as a fallback “when there is no information about the standard deviation and/or it is difficult to specify an effect size”, of value “for some exploratory experiments when testing hypotheses is not the main objective”, and give the rule that the error degrees of freedom “should be approximately 10 to 20” (Festing & Altman 2002).

Check what an AI assistant ran

  1. A “medium effect” (f = 0.25) entered without a source. Ask for the expected means and SD instead.
  2. statsmodels’ nobs read as animals per group. It is the total; divide by the number of groups.
  3. An omnibus calculation for a study that will report pairwise comparisons. Ask for the calculation for the planned comparison, with the adjusted α.
  4. Post hoc power from the data already collected. It adds nothing to the p-value; use the planned calculation (reviewer asks to justify the sample size).

Report it

The experimental unit was the individual [mouse]. The sample size was based on the planned comparisons of each dose with vehicle by Dunnett’s test (familywise two-sided α = 0.05). Assuming an SD of [12] units ([source: pilot study / published data]) and a smallest relevant difference of [10] units, [31] mice per group give 80% power, calculated with α = 0.05/3 per comparison as a conservative approximation to Dunnett’s adjustment (Python [3.13] / R [4.3.3]). [Number] additional mice per group were included to allow for [expected losses].

For an exploratory study:

No estimate of variability was available, so the sample size was set by the resource equation ([Festing & Altman 2002]): [6] mice in each of [4] groups, giving [20] error degrees of freedom. The study was exploratory and was not powered for specific comparisons.

Replace the bracketed values with your own.

References

  • NC3Rs. Experimental Design Assistant: group and sample size. eda.nc3rs.org.uk (checked 11 November 2026)
  • ARRIVE 2.0. Item 2b, explanation. arriveguidelines.org (checked 11 November 2026)
  • Mayer B, Tuckermann J, Muche R (2022). Could a phase model help to improve translational animal research? Animal Models and Experimental Medicine 5:550–556. doi:10.1002/ame2.12284
  • Festing MFW, Altman DG (2002). Guidelines for the design and statistical analysis of experiments using laboratory animals. ILAR Journal 43:244–258. doi:10.1093/ilar.43.4.244

How this page was made

  • Written and published by Licklider. Recommendations cite ARRIVE 2.0, NC3Rs guidance and peer-reviewed methods papers listed under References; cited passages were checked against the source text.
  • The worked example uses assumed values. Its numbers were produced by stored code (Python 3.13 with SciPy 1.18.1; R 4.3.3, base R), and the two languages print identical output; the page snippets reproduce the two-group and omnibus calculations with statsmodels 0.15.0 and pwr 1.3-0; the Dunnett check was simulated in Python.
  • Separate review passes checked the statistics, the citations and readability before publication.