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.

Clinical Trials

Real trials behind this calculation

See the analysis this calculator plans for applied to published trial results, with the estimates, confidence intervals and interpretation explained.

SPIRE-1
An independent statistical analysis of SPIRE-1 (NCT01975376), the terminated phase 3 placebo-controlled trial of bococizumab for prevention of major cardiovascular events: stratified…
Phase 3 · n = 16,784
SPIRE-2
Independent statistical analysis of SPIRE-2 (NCT01975389), the terminated phase 3 placebo-controlled trial of bococizumab in high-risk participants: stratified Cox hazard ratios for…
Phase 3 · n = 10,564
CARES
Independent statistical analysis of Community Collaboration to Advance Racial/Ethnic Equity in CRC Screening: primary endpoint results, effect estimate with confidence interval, sample-size…
Phase NA · n = 5,127
INVIGORATE
Independent statistical analysis of Exacerbation Study: primary endpoint results, effect estimate with confidence interval, sample-size planning illustration, and safety, based on ClinicalTrials.gov…
Phase 3 · n = 3,439
ACTIVE
Independent statistical analysis of ACTIVE: Advanced Cognitive Training for Independent and Vital Elderly: primary endpoint results, effect estimate with confidence interval, sample-size…
Phase 2/3 · n = 2,832
OAKTREE
Complete statistical analysis of the randomized phase 3 OAKTREE trial of obeldesivir in nonhospitalized participants with COVID-19, including trial design, endpoints, survival…
Phase 3 · n = 2,011
See all 2,067 trials using MMRM (mixed model for repeated measures) →
Clinical Biostats