Sample size calculation for testing if mean changes for 2 groups are the same or not for longitudinal study with 2 time point.

1 2 3 4 |

`es` |
effect size of the difference of mean change. |

`rho` |
correlation coefficient between baseline and follow-up values within a treatment group. |

`alpha` |
Type I error rate. |

`power` |
power for testing for difference of mean changes. |

The sample size formula is based on Equation 8.30 on page 335 of Rosner (2006).

*
n=\frac{2σ_d^2 (Z_{1-α/2} + Z_{power})^2}{δ^2}
*

where *σ_d = σ_1^2+σ_2^2-2ρσ_1σ_2*, *δ=|μ_1 - μ_2|*,
*μ_1* is the mean change over time *t* in group 1,
*μ_2* is the mean change over time *t* in group 2,
*σ_1^2* is the variance of baseline values within a treatment group,
*σ_2^2* is the variance of follow-up values within a treatment group,
*ρ* 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 *μ_1 = μ_2*.

When *σ_1=σ_2=σ*, then formula reduces to

*
n=\frac{4(1-ρ)(Z_{1-α/2}+Z_{β})^2}{d^2}
*

where *d=δ/σ*.

required sample size per group

Weiliang Qiu stwxq@channing.harvard.edu

Rosner, B.
*Fundamentals of Biostatistics*. Sixth edition. Thomson Brooks/Cole. 2006.

`ssLongFull`

, `powerLong`

,
`powerLongFull`

.

1 2 3 |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.