ssLong.multiTime:
Sample size calculation for testing if mean changes for 2 groups are the
same or not for longitudinal study with more than 2 time points
Description
Sample size calculation for testing if mean changes for 2 groups are the
same or not for longitudinal study with more than 2 time points.
We are interested in comparing the slopes of the 2 groups $A$ and $B$:
$$
\beta_{1A} = \beta_{1B}
$$
where
$$
Y_{ijA}=\beta_{0A}+\beta_{1A} x_{jA} + \epsilon_{ijA}, j=1, \ldots, nn; i=1, \ldots, m
$$
and
$$
Y_{ijB}=\beta_{0B}+\beta_{1B} x_{jB} + \epsilon_{ijB}, j=1, \ldots, nn; i=1, \ldots, m
$$
The sample size calculation formula is (Equation on page 30 of Diggle et al. (1994)):
$$
m=\frac{2\left(Z_{1-\alpha}+z_{power}\right)^2 \left(1-\rho\right)}{
nn s_x^2 es^2}
$$
where $es=d/\sigma$, $d$ is the meaninful differnce of interest,
$sigma^2$ is the variance of the random error,
$\rho$ is the within-subject correlation, and
$s_x^2$ is the within-subject variance.
References
Diggle PJ, Liang KY, and Zeger SL (1994).
Analysis of Longitundinal Data. page 30.
Clarendon Press, Oxford