Mixed Models and Longitudinal Data
Estimate the total number of subjects required for a two-arm longitudinal study with a continuous outcome analyzed using generalized estimating equations (GEE). The calculation accounts for repeated measurements and within-subject correlation through the working correlation matrix.
This calculator implements the continuous-outcome, two-group special case of the generalized estimating equation sample-size framework described by Liu and Liang (1997). Their method extends generalized linear-model sample size calculations to correlated observations using the generalized score statistic. The GEE framework itself was introduced by Liang and Zeger (1986) for marginal modeling of correlated longitudinal data.
For two equally sized treatment groups, a continuous outcome, equal numbers of repeated measurements, and a two-sided test, the required total number of subjects before rounding is
Here, Δ is the treatment-group difference to be detected, σ is the marginal standard deviation, α is the two-sided type I error rate, 1−β is power, and R is the working correlation matrix for the repeated measurements. The quantity 1′R−11 describes how the correlation structure changes the amount of information contributed by the repeated observations.
K is the number of repeated measurements per subject and ρ is the within-subject correlation. Under positive correlation, repeated observations provide less information than K independent observations. Consequently, the required number of subjects generally increases as the correlation increases.
If a proportion d of enrolled subjects is expected to be unavailable for the primary analysis, the calculated analyzable sample size is divided by (1−d). The enrollment target is then rounded upward to an even number for the specified 1:1 allocation.
As a fixed implementation check, consider a two-arm longitudinal study with α = 0.05, 80% power, a treatment difference of 5 units, SD = 10 units, four measurements per subject, exchangeable correlation ρ = 0.50, and no dropout.
The calculator uses the same inputs and formula and therefore returns a total enrollment target of 80 subjects for this validation case.
Liu, G. & Liang, K. Y. (1997). Sample size calculations for studies with correlated observations. Biometrics, 53(3), 937–947. DOI: 10.2307/2533554.
Zeger, S. L. & Liang, K. Y. (1986). Longitudinal data analysis for discrete and continuous outcomes. Biometrics, 42(1), 121–130.
PASS Statistical Software Documentation — official PASS documentation includes GEE procedures and technical sample-size details.
Scope: This implementation is the continuous-outcome, two-arm, equal-allocation special case with complete repeated measurements. Binary/count outcomes, unequal allocation, arbitrary covariate matrices, missing-data patterns, and general non-exchangeable correlation matrices require the corresponding specialized GEE sample-size formulation or numerical calculation.