Longitudinal Models · LMM-2G-T
Sample Size for Two-Group Linear Mixed Model: Difference at a Specified Follow-Up Time
Plan a Wald test of the comparison-minus-reference marginal mean difference at one prespecified follow-up while using the complete repeated-measurement schedule.
4. Results
Enter the longitudinal design assumptions and select Calculate.
Suggested sample-size wording
Warnings
Formula, assumptions, limitations, and methodological note
Example clinical scenario
A randomized hypertension study measures systolic blood pressure at baseline and at 1, 3, 6, and 12 months. The primary endpoint is the treatment-group difference at 12 months. Earlier measurements are included in the longitudinal model, but the hypothesis concerns only the prespecified 12-month comparison.
Formula and methodological note
The model uses categorical visit means and visit-specific comparison-minus-reference contrasts. The target contrast has weight one at the selected follow-up and zero at every other visit. For participant covariance V = ZGZ′ + R, group generalized least-squares information matrices are combined at the allocation ratio and target-effect variance is c′(X′V⁻¹X)⁻¹c. Exact allocation multiples are searched until normal-theory Wald power reaches the target.
When baseline is included, randomized groups share a common baseline mean and baseline receives zero target-contrast weight. The method assumes a continuous outcome, common equally spaced visits, independent participants, credible covariance parameters, and randomized groups for baseline adjustment. Dropout is recruitment inflation only. It excludes irregular schedules, joint or omnibus contrasts, partial or informative missingness, clusters, crossed effects, and non-Gaussian outcomes. This tool supports research planning and does not replace statistical consultation.
Technical results
Method references
- Diggle PJ, Heagerty P, Liang KY, Zeger SL. Analysis of Longitudinal Data. 2nd ed. Oxford University Press; 2002.
- Statsmodels developers. NormalIndPower documentation.
Suggested citation
Yaacob, Najib Majdi. “Sample Size for Two-Group Linear Mixed Model: Difference at a Specified Follow-Up Time (LMM-2G-T).” Web calculator. NajibMY, 2026. Accessed August 1, 2026. https://najibmy.netlify.app/tools/sample-size/clinical-complex-study-designs/linear-mixed-model-difference-at-follow-up/.