Statistical Calculators › Mixed Models and Longitudinal Data › MMRM Sample Size Calculator
← All Calculators

Mixed Models and Longitudinal Data

MMRM Sample Size Calculator

Sample size for a two-group longitudinal study testing the treatment difference at the final visit with a fixed-slope repeated-measures mixed model. The calculation follows the published this method formulation from Ahn, Heo & Zhang (2015), including within-subject correlation and the number of repeated measurements.

Study Design

Enter the effect, variability, repeated-measures structure, and desired operating characteristics.
The model assumes equally spaced measurements, a common fixed slope, equal within-subject correlation at all time pairs, and identical baseline means between groups.

Required Sample Size

The result is the smallest integer allocation that reaches the requested power under the specified model.
Enter the design assumptions and click Calculate Sample Size.

Methodology

This calculator implements the two-group, two-level longitudinal mixed model described by Ahn, Heo, and Zhang (2015) and used in the this method procedure Mixed Models Tests for Two Means at the End of Follow-Up in a 2-Level Hierarchical Design. Subjects are randomized to treatment or control and measured repeatedly over equally spaced time points. The estimand is the treatment difference at the final measurement.

Model

The fixed-slope model can be written as a baseline intercept plus treatment, time, and treatment-by-time terms, with a subject-specific random intercept and measurement error. Time is rescaled so the final visit is zero; the treatment coefficient at that visit is therefore the final-visit mean difference.

Yij = β0 + δeXi + τSij + δfXiSij + ui + eij

Sample-size calculation

For M equally spaced measurements, the variance of the rescaled time variable is V(S) = (M2 − 1)/12 and its mean is S̄ = −(M − 1)/2. The this method/Ahn formulation defines f = 1 + (M − 1)ρ and C(2) = 1 + (1 − ρ)/(CV(S)2f), where CV(S)2 = V(S)/S̄2.

Power = Φ { |δe|/σ × √[K2M / ((1 + λ−1) C(2) f)] − Φ−1(1 − α/2) }
λ = K1/K2

The calculator searches over integer control-group sample sizes and applies the requested treatment:control allocation ratio. It reports the first allocation whose computed power is at least the target. If a dropout rate is entered, the analyzable sample size is calculated first and then inflated by 1/(1 − dropout), rounding each group up.

Assumptions and scope

Validation example

This yields a published validation example from Ahn, Heo, and Zhang (2015): power = 0.80, α = 0.05, final-visit mean difference = 0.4, SD = 1, within-subject correlation = 0.1, and M = 5. With equal allocation, the required sample size is 63 subjects per group (126 total), with achieved power 0.8013. This calculator reproduces that result.

References

Ahn, C., Heo, M., & Zhang, S. (2015). Sample Size Calculations for Clustered and Longitudinal Outcomes in Clinical Research. CRC Press, New York. the relevant methodological literature identifies this book, Chapter 5, Section 5.4.4, pages 165–167, as the source of the fixed-slope longitudinal mixed-model formulation.

the software, LLC. this method Sample Size Software: Mixed Models Tests for Two Means at the End of Follow-Up in a 2-Level Hierarchical Design, Chapter 372. This method uses the model, power formula, examples, and the Ahn, Heo & Zhang validation example.