Method document
Sample size for a repeated-measures ANOVA
How many participants are needed to show that a measurement changes across several occasions in the same people, with chosen significance and power. Allows for the correlation between occasions and for departures from sphericity. Covers clustering and dropout.
https://statwisely.com/methods/means-repeated-anova/
When to use it
- One group measured on three or more occasions, testing whether the mean changes over time or across conditions.
Not for
- Comparing how groups change over time (a group-by-time interaction). Use the longitudinal designs.
- Only two occasions. Use the paired t-test.
Notation
- Number of participants
- Number of occasions measured
- Cohen’s f for the change across occasions
- Correlation between occasions
- Sphericity correction, from 1/(M − 1) to 1
- Noncentrality of the F distribution
- Significance level: the chance of a false positive
- Power: the chance of detecting the effect if it is real
- Intracluster correlation coefficient (ICC)
- Average number of participants per cluster
- Coefficient of variation of cluster size
- Clusters per group
- Expected loss of whole clusters
- Expected dropout
Formulas
The smallest N with enough power
The within-subject F test, powered on the noncentral F distribution [1]. A stronger correlation between occasions removes more between-person variation, so it raises λ and lowers N; a sphericity correction ε below 1 lowers both degrees of freedom and λ, as the Greenhouse–Geisser analysis does [2].
Clustering
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
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
The adjustments multiply, in this order, and the result is rounded up once. Any adjustment not used contributes a factor of 1.
Dropout
Applied last, to the participants actually recruited.
Clusters to recruit
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 f
Values: Above 0
The SD of the occasion means divided by the within-occasion SD. Benchmarks of 0.10, 0.25 and 0.40 are a last resort [3].
Number of occasions
Values: A whole number of at least 2
Every participant is measured on every occasion.
Correlation between occasions
Values: At least 0 and below 1
How strongly a person’s measurements track each other, from previous data. Repeated measurements of the same person are often correlated 0.5 or more; assuming too strong a correlation undersizes the study.
Sphericity correctionOptional
Values: Above 0 and at most 1; 1 assumes sphericity
Below 1 when occasions further apart are less correlated than adjacent ones, as is common over time. 0.75 is a cautious choice when unsure.
Significance level
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.
Power
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 dropoutOptional
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.
Intracluster correlation (ICC)Optional
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 sizeOptional
Values: At least 1
The average number of participants per cluster. Given with the ICC.
Variation in cluster sizeOptional
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 clustersOptional
Values: 0% up to, but not including, 100%
Clusters, such as practices or schools, expected to withdraw entirely.
Correction for few clustersOptional
Values: On or off
Worth applying when there are few clusters per group, roughly fewer than 15–20.
Assumptions
- Participants are independent of one another apart from any clustering specified, and complete every occasion.
- The occasions share one correlation (compound symmetry), relaxed by the sphericity correction ε.
- Power is for the overall within-subject test, not for a particular contrast such as a linear trend.
- 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 occasions
f = 0.25, 3 occasions correlated 0.5, sphericity assumed; α = 0.05, 80% power: 28 participants.
Sample size: 28
Open this example in the calculatorProtocol statement
To detect a change across occasions of f = 0.25 with 80% power at a significance level of 0.05, using a repeated-measures ANOVA over 3 occasions, and assuming a correlation of 0.5 between occasions, the required sample size is 28 participants. Calculated with StatWisely (statwisely.com) using: n: solve noncentral-F power for the within-subject effect; df₁=(m-1)ε, df₂=(N-1)(m-1)ε, λ=f²Nmε/(1-ρ). These are planning estimates; confirm the final design with a qualified statistician.
Allowing for non-sphericity
The same design with ε = 0.75: 34 participants.
Sample size: 34
Open this example in the calculatorMore strongly correlated occasions
With a correlation of 0.8: only 12 participants, because each person serves as a closer control for themselves.
Sample size: 12
Open this example in the calculatorValidation
- 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.
How to cite
StatWisely. Sample size for a repeated-measures ANOVA. Method document, engine version 1.0.0, reviewed 2026-10-01. https://statwisely.com/methods/means-repeated-anova/
Cite the original references for the formulas your design uses as well.
References
- 1.Muller KE, Barton CN. Approximate power for repeated-measures ANOVA lacking sphericity. Journal of the American Statistical Association. 1989;84(406):549–555.
- 2.Greenhouse SW, Geisser S. On methods in the analysis of profile data. Psychometrika. 1959;24(2):95–112.
- 3.Cohen J. Statistical Power Analysis for the Behavioral Sciences. 2nd ed. Hillsdale, NJ: Lawrence Erlbaum Associates; 1988.
- 4.Donner A, Klar N. Design and Analysis of Cluster Randomization Trials in Health Research. London: Arnold; 2000.
- 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.Hayes RJ, Moulton LH. Cluster Randomised Trials. 2nd ed. Boca Raton: CRC Press; 2017.
- 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