powerLong:
Power calculation for longitudinal study with 2 time point
Description
Power calculation for testing if mean changes for 2 groups are the same or not for longitudinal study with 2 time point.
Usage
powerLong(es, n, rho = 0.5, alpha = 0.05)
Arguments
es
effect size of the difference of mean change.
n
sample size per group.
rho
correlation coefficient between baseline and follow-up values within a treatment group.
alpha
Type I error rate.
Value
power for testing for difference of mean changes.
Details
The power formula is based on Equation 8.31 on page 336 of Rosner (2006).
$$
power=\Phi\left(-Z_{1-\alpha/2}+\frac{\delta\sqrt{n}}{\sigma_d \sqrt{2}}\right)
$$
where $\sigma_d = \sigma_1^2+\sigma_2^2-2\rho\sigma_1\sigma_2$, $\delta=|\mu_1 - \mu_2|$,
$\mu_1$ is the mean change over time $t$ in group 1,
$\mu_2$ is the mean change over time $t$ in group 2,
$\sigma_1^2$ is the variance of baseline values within a treatment group,
$\sigma_2^2$ is the variance of follow-up values within a treatment group,
$\rho$ is the correlation coefficient between baseline and follow-up values within a treatment group,
and $Z_u$ is the u-th percentile of the standard normal distribution.
We wish to test $\mu_1 = \mu_2$.
When $\sigma_1=\sigma_2=\sigma$, then formula reduces to
$$
power=\Phi\left(-Z_{1-\alpha/2} + \frac{|d|\sqrt{n}}{2\sqrt{1-\rho}}\right)
$$
where $d=\delta/\sigma$.
References
Rosner, B.
Fundamentals of Biostatistics. Sixth edition. Thomson Brooks/Cole. 2006.