Skip to main content

    Method document

    Sample size to estimate a change over time in repeated measurements

    How many participants are needed to estimate the mean change per unit of time of a numerical outcome measured repeatedly in one group, from a linear mixed model or GEE, within a chosen margin. Assumes equally spaced visits and compound symmetry. Covers non-response.

    Engine version 1.0.0 · Reviewed 4 October 2026

    https://statwisely.com/methods/precision-time-slope/

    When to use it

    • A cohort followed with repeated measurements, such as lung function each year, when the rate of change and its interval are the aim.

    Not for

    • Comparing rates of change between groups. Use the longitudinal slopes test.
    • Unequal visit schedules, a correlation that fades with time, or much missing data; these need their own calculation or a simulation.

    Notation

    nn
    Number of participants
    σ\sigma
    Standard deviation of the outcome at any one visit
    EE
    Margin of error, in outcome units per unit of time
    mm
    Measurements per participant, equally spaced over the follow-up
    TT
    Length of follow-up, in the time unit of the effect
    st2s_t^{2}
    Variance of the measurement times, T²(m + 1)/[12(m − 1)]
    ρ\rho
    Correlation between two measurements on the same participant
    z1−α/2z_{1-\alpha/2}
    Standard normal quantile for confidence 1 − α (1.960 for 95%)
    qq
    Non-response rate

    Formulas

    The slope’s variance under compound symmetry

    n=⌈z1−α/22 σ2(1−ρ)m st2 E2⌉n = \left\lceil \frac{z_{1-\alpha/2}^{2}\,\sigma^{2}(1-\rho)}{m\,s_t^{2}\,E^{2}} \right\rceil

    A participant’s own level drops out of their slope, so only the within-person variance σ²(1 − ρ) is paid for, spread over the visits and their span [1]. This is the one-group form of the longitudinal slopes calculation.

    Non-response

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

    The number to approach so that n respond. Applied last, after any clustering.

    Parameters

    Confidence level1−α1-\alpha

    Values: 90%, 95% or 99%

    95% is the convention in health research. A higher level widens the interval, so the same margin needs a larger sample.

    Margin of errorEE

    Values: Above 0, outcome units per time unit

    Half the width of the interval wanted around the rate of change.

    Standard deviation at one visitσ\sigma

    Values: Above 0

    Between participants at a single time point.

    Measurements per participantmm

    Values: A whole number of at least 2

    Including the first. More visits help, but less than a longer follow-up does.

    Follow-up lengthTT

    Values: Above 0

    In the unit the change is expressed in: a change per month needs the follow-up in months.

    Correlation between measurementsρ\rho

    Values: At least 0 and below 1

    From a previous study of the same outcome. A higher correlation means each participant’s own trajectory is clearer, so fewer are needed.

    Expected non-response rateqqOptional

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

    The share of people approached who will not take part; use the response rate of a comparable study. Approaching more people restores the number of respondents, not their representativeness: if non-responders differ, the estimate can still be biased.

    Assumptions

    • Participants are independent; within a participant every pair of measurements correlates equally (compound symmetry); visits are equally spaced and the change is linear.
    • Non-response is unrelated to the outcome.

    Worked examples

    Four yearly visits

    SD 10, ρ = 0.6, 4 visits over 3 years, so s_t² = 1.25: n = 1.96² × 100 × 0.4 / (4 × 1.25 × 0.25) = 122.9, rounded up to 123.

    Sample size: 123

    Open this example in the calculator

    More visits over the same period

    7 visits over the same 3 years: n = 88.

    Sample size: 88

    Open this example in the calculator

    Allowing for dropout

    Expecting 15% to drop out: 123 / 0.85 = 144.7, so 145 are enrolled.

    Needed for analysis: 123 · To approach: 145

    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.
    • Fitting random-intercept models with nlme::lme in R to 1,000 simulated cohorts of 123 participants, four visits over three years, gave a median interval half-width of 0.4995 against a target of 0.5. An independent R evaluation of the formula reproduces the engine’s sizes.

    How to cite

    StatWisely. Sample size to estimate a change over time in repeated measurements. Method document, engine version 1.0.0, reviewed 2026-10-04. https://statwisely.com/methods/precision-time-slope/

    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.