Skip to main content

    Method document

    Sample size for a one-way ANOVA

    How many participants are needed in each of several independent groups to show that the group means are not all equal, with chosen significance and power. Covers a baseline covariate, clustering and dropout.

    Engine version 1.0.0 · Reviewed 1 October 2026

    https://statwisely.com/methods/means-anova/

    When to use it

    • Three or more independent groups compared on a continuous outcome, with the overall F test as the primary analysis.

    Not for

    • Several treatments each compared with one control. Use the multi-arm comparison, which powers the comparisons that matter.
    • The same people measured several times. Use repeated-measures ANOVA.

    Notation

    kk
    Number of groups
    NN
    Total number of participants
    ff
    Cohen’s f: the SD of the group means divided by the within-group SD
    λ\lambda
    Noncentrality of the F distribution
    α\alpha
    Significance level: the chance of a false positive
    1−β1-\beta
    Power: the chance of detecting the effect if it is real
    rbr_b
    Correlation between the outcome and a baseline covariate
    ρ\rho
    Intracluster correlation coefficient (ICC)
    mm
    Average number of participants per cluster
    CV\mathrm{CV}
    Coefficient of variation of cluster size
    CC
    Clusters per group
    ℓ\ell
    Expected loss of whole clusters
    qq
    Expected dropout

    Formulas

    The smallest N with enough power

    Pr⁡ ⁣(Fk−1, N−k, λ′>Fk−1, N−k, 1−α)≥1−β,λ=f2N\Pr\!\left(F'_{k-1,\,N-k,\,\lambda} > F_{k-1,\,N-k,\,1-\alpha}\right) \ge 1-\beta, \qquad \lambda = f^{2} N

    When the means differ, the F statistic follows a noncentral F distribution with k − 1 and N − k degrees of freedom; N is the smallest total whose power reaches the target, then divided equally and rounded up per group [1].

    Cohen’s f from expected means

    f=σmσ,σm=1k∑i=1k(μi−μˉ)2f = \frac{\sigma_m}{\sigma}, \qquad \sigma_m = \sqrt{\frac{1}{k}\sum_{i=1}^{k} (\mu_i - \bar{\mu})^{2}}

    From the means you expect in each group and the common within-group SD. For two groups, f = d / 2.

    Adjusting for a baseline covariate

    n′=⌈n (1−rb2)⌉+1n' = \left\lceil n\,(1 - r_b^{2}) \right\rceil + 1

    Analysing with a baseline measurement as a covariate (ANCOVA) removes the share r_b² of the outcome’s variance the test would otherwise have to overcome. One participant per group is added back for the degree of freedom the covariate uses [3].

    Clustering

    DE=1+[(CV2+1) m−1]ρ\mathrm{DE} = 1 + \left[(\mathrm{CV}^{2} + 1)\,m - 1\right]\rho

    When participants are recruited or randomised in clusters, observations within a cluster repeat information, and the sample is multiplied by the design effect. With equal clusters (CV = 0) this is 1 + (m − 1)ρ [4, 5].

    Few clusters

    Ft=(t2(C−1), 1−α/τ+t2(C−1), 1−βz1−α/τ+z1−β)2F_t = \left(\frac{t_{2(C-1),\,1-\alpha/\tau} + t_{2(C-1),\,1-\beta}}{z_{1-\alpha/\tau} + z_{1-\beta}}\right)^{2}

    Optional. A cluster trial is analysed on cluster-level summaries, so its critical values come from t on 2(C − 1) degrees of freedom rather than the normal distribution. With few clusters this costs participants; because C depends on the sample, it is iterated until it settles [6].

    All adjustments together

    nadj=⌈n(1−rb2) DE  Ft⌉+1n_{\text{adj}} = \left\lceil n (1 - r_b^{2})\,\mathrm{DE}\;F_t \right\rceil + 1

    The adjustments multiply, in this order, and the result is rounded up once. Any adjustment not used contributes a factor of 1.

    Dropout

    nrecruit=⌈nadj1−q⌉n_{\text{recruit}} = \left\lceil \frac{n_{\text{adj}}}{1 - q} \right\rceil

    Applied last, to the participants actually recruited.

    Clusters to recruit

    C=⌈nrecruitm⌉,Crecruit=⌈C1−ℓ⌉C = \left\lceil \frac{n_{\text{recruit}}}{m} \right\rceil, \qquad C_{\text{recruit}} = \left\lceil \frac{C}{1 - \ell} \right\rceil

    Per group. Losing a whole cluster loses every participant in it, so an expected loss of clusters inflates the clusters recruited rather than the participants.

    Parameters

    Cohen’s fff

    Values: Above 0

    Best computed from the group means you expect, with the formula above. Cohen’s benchmarks of 0.10, 0.25 and 0.40 for small, medium and large are a last resort [1].

    Number of groupskk

    Values: A whole number of at least 2

    All groups are assumed to be the same size.

    Significance levelα\alpha

    Values: Between 0 and 1; usually 0.05

    The false-positive rate you accept. A smaller α, for example to allow for several primary outcomes, needs a larger sample.

    Power1−β1-\beta

    Values: Between 0 and 1; usually 0.80 or 0.90

    The chance of a significant result if the assumed effect is real. Funders and ethics committees commonly expect at least 0.80.

    Expected dropoutqqOptional

    Values: 0% up to, but not including, 100%

    The share of participants expected to provide no outcome, from comparable studies. Recruiting more restores the numbers, not the comparability of the groups: if dropout is related to the outcome, the estimate can still be biased.

    Baseline correlationrbr_bOptional

    Values: Between −1 and 1

    The correlation between the outcome and its baseline measurement, from previous data. Only use it if the analysis will adjust for the baseline.

    Intracluster correlation (ICC)ρ\rhoOptional

    Values: From 0 to 1

    For clustered designs only. Published ICCs for health outcomes in primary-care and community clusters are mostly small, often below 0.05 [7]; prefer an estimate from a comparable trial.

    Average cluster sizemmOptional

    Values: At least 1

    The average number of participants per cluster. Given with the ICC.

    Variation in cluster sizeCV\mathrm{CV}Optional

    Values: 0 or more; 0 for equal clusters

    The SD of cluster sizes divided by their mean. Unequal clusters cost power on their own account [5].

    Expected loss of whole clustersℓ\ellOptional

    Values: 0% up to, but not including, 100%

    Clusters, such as practices or schools, expected to withdraw entirely.

    Correction for few clustersFtF_tOptional

    Values: On or off

    Worth applying when there are few clusters per group, roughly fewer than 15–20.

    Assumptions

    • The groups are independent and equal in size, and participants are independent apart from any clustering specified.
    • The outcome is roughly normal with the same standard deviation in every group.
    • Power is for the overall F test. Pairwise comparisons after it, with a multiplicity correction, need their own sample size and are usually less powerful.
    • With clustering: clusters are independent, with the same ICC throughout, and the analysis accounts for the clustering, for example with a mixed model or cluster-level summaries [4].
    • Dropout is unrelated to the outcome; recruiting more participants restores the numbers but cannot remove bias.

    Worked examples

    Three groups, a medium effect

    f = 0.25, 3 groups, α = 0.05, 80% power: N = 159, so 53 per group.

    53 per group · Total: 159

    Protocol statement

    To detect an effect size of f = 0.25 with 80% power at a significance level of 0.05, using a one-way ANOVA across 3 groups, the required sample size is 53 per group (159 in total, across 3 groups). Calculated with StatWisely (statwisely.com) using: N: solve the noncentral-F power equation for Cohen's f, k groups, α, and 1-β. These are planning estimates; confirm the final design with a qualified statistician.

    Open this example in the calculator

    Four groups

    The same effect across 4 groups: 180 in total, 45 per group. Each group needs fewer, but the total grows.

    45 per group · Total: 180

    Open this example in the calculator

    A small effect

    f = 0.1 across 3 groups: 969 in total, 323 per group. A small effect needs about six times the sample of a medium one.

    323 per group · Total: 969

    Open this example in the calculator

    Validation

    • Every worked example on this page is recomputed by the StatWisely engine whenever the software is built. If a number or formula here stopped matching the calculator, the release would be stopped until this document was corrected.
    • An independent implementation in R recomputes this test every night and before each production release, and the results are compared with the engine’s.
    • The results agree with G*Power’s one-way ANOVA: 159 in total for f = 0.25 and three groups, 180 for four groups, and 969 for f = 0.10 and three groups, at α = 0.05 and 80% power [2].

    How to cite

    StatWisely. Sample size for a one-way ANOVA. Method document, engine version 1.0.0, reviewed 2026-10-01. https://statwisely.com/methods/means-anova/

    Cite the original references for the formulas your design uses as well.

    References

    1. 1.Cohen J. Statistical Power Analysis for the Behavioral Sciences. 2nd ed. Hillsdale, NJ: Lawrence Erlbaum Associates; 1988.
    2. 2.Faul F, Erdfelder E, Lang AG, Buchner A. G*Power 3: a flexible statistical power analysis program for the social, behavioral, and biomedical sciences. Behavior Research Methods. 2007;39(2):175–191.
    3. 3.Borm GF, Fransen J, Lemmens WAJG. A simple sample size formula for analysis of covariance in randomized clinical trials. Journal of Clinical Epidemiology. 2007;60(12):1234–1238.
    4. 4.Donner A, Klar N. Design and Analysis of Cluster Randomization Trials in Health Research. London: Arnold; 2000.
    5. 5.Eldridge SM, Ashby D, Kerry S. Sample size for cluster randomized trials: effect of coefficient of variation of cluster size and analysis method. International Journal of Epidemiology. 2006;35(5):1292–1300. doi:10.1093/ije/dyl129
    6. 6.Hayes RJ, Moulton LH. Cluster Randomised Trials. 2nd ed. Boca Raton: CRC Press; 2017.
    7. 7.Adams G, Gulliford MC, Ukoumunne OC, Eldridge S, Chinn S, Campbell MJ. Patterns of intra-cluster correlation from primary care research to inform study design and analysis. Journal of Clinical Epidemiology. 2004;57(8):785–794. doi:10.1016/j.jclinepi.2003.12.013