Skip to main content

    Method document

    Sample size for repeated measures: comparing average levels across follow-up

    How many participants are needed in each of two groups to show that their average levels differ, when each participant is measured several times and their measurements are averaged. Covers unequal groups, one- or two-sided tests and dropout.

    Engine version 1.0.0 · Reviewed 1 October 2026

    https://statwisely.com/methods/longitudinal-mean-level/

    When to use it

    • An outcome measured repeatedly to reduce noise, such as blood pressure at several visits, compared between groups.

    Not for

    • Questions about change over time. Use the rates of change.

    Notation

    n1, n2n_1,\ n_2
    Participants in groups 1 and 2
    MM
    Measurements per participant
    σ\sigma
    Standard deviation of a single measurement
    ρm\rho_m
    Correlation between any two measurements on a participant
    Δ\Delta
    Difference to detect between the groups
    rar_a
    Allocation ratio n₂ / n₁
    α\alpha
    Significance level: the chance of a false positive
    1−β1-\beta
    Power: the chance of detecting the effect if it is real
    τ\tau
    Number of tails: 2 for a two-sided test, 1 for one-sided
    qq
    Expected dropout

    Formulas

    Variance of the difference in average levels

    Var⁡(Δ^)=σ2 1+(M−1)ρmM(1n1+1n2)\operatorname{Var}(\hat{\Delta}) = \sigma^{2}\,\frac{1 + (M-1)\rho_m}{M}\left(\frac{1}{n_1} + \frac{1}{n_2}\right)

    Averaging M correlated measurements reduces the variance by the factor [1 + (M − 1)ρ]/M, which is never above 1: measuring repeatedly is never worse than measuring once. The more strongly the measurements are correlated, the less each extra one adds [1]. n₁ is solved on the noncentral t distribution.

    Dropout

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

    Applied last, to the participants actually recruited.

    Parameters

    Difference in average levelΔ\Delta

    Values: Not zero

    The difference between the groups’ average levels over the follow-up.

    Standard deviationσ\sigma

    Values: Above 0

    Of a single measurement, from previous data.

    Measurements per participantMM

    Values: At least 1

    Planned visits, equally spaced.

    Correlation between measurementsρm\rho_m

    Values: At least 0 and below 1

    How strongly a participant’s measurements track each other, from previous data.

    Allocation ratiorar_aOptional

    Values: Above 0; 1 for equal groups

    The planned size of group 2 divided by group 1.

    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.

    One- or two-sidedτ\tau

    Values: 2 (two-sided) or 1 (one-sided)

    Two-sided is the default. A one-sided test is justified only when an effect in the other direction would be treated exactly as no effect, and should be stated in advance.

    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.

    Assumptions

    • Compound symmetry: every pair of measurements on a participant is equally correlated. Other covariance structures, such as correlation that fades with time, can change power in either direction.
    • Every participant completes every visit; dropout is allowed for by recruiting more, not by modelling partial data.
    • Dropout is unrelated to the outcome; recruiting more participants restores the numbers but cannot remove bias.

    Worked examples

    Five measurements each

    A difference of 1 with SD 2, 5 measurements correlated 0.5: the factor is (1 + 4 × 0.5) / 5 = 0.6, so 39 per group, against 64 with a single measurement.

    Group 1: 39 · Group 2: 39 · Total: 78

    Protocol statement

    To detect a difference of 1 with 80% power at a two-sided significance level of 0.05, using a comparison of average levels over 5 measurements per participant, and assuming a standard deviation of 2 and a correlation of 0.5 between measurements, the required sample size is 39 per group (78 in total). Calculated with StatWisely (statwisely.com) using: n₁: Var(Δmean)=σ²[1+(m-1)r]/m × (1/n₁+1/n₂), solved on noncentral t. These are planning estimates; confirm the final design with a qualified statistician.

    Open this example in the calculator

    More strongly correlated measurements

    With a correlation of 0.8 the factor is 0.8400000000000001: 54 per group. Repetition helps less when measurements agree.

    Group 1: 54 · Group 2: 54 · Total: 108

    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.

    How to cite

    StatWisely. Sample size for repeated measures: comparing average levels across follow-up. Method document, engine version 1.0.0, reviewed 2026-10-01. https://statwisely.com/methods/longitudinal-mean-level/

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

    References

    1. 1.Diggle PJ, Heagerty P, Liang KY, Zeger SL. Analysis of Longitudinal Data. 2nd ed. Oxford: Oxford University Press; 2002.