ssLong {powerMediation} | R Documentation |
Sample size calculation for longitudinal study with 2 time point
Description
Sample size calculation for testing if mean changes for 2 groups are the same or not for longitudinal study with 2 time point.
Usage
ssLong(es,
rho = 0.5,
alpha = 0.05,
power = 0.8)
Arguments
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. |
Details
The sample size formula is based on Equation 8.30 on page 335 of Rosner (2006).
where ,
,
is the mean change over time
in group 1,
is the mean change over time
in group 2,
is the variance of baseline values within a treatment group,
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
is the u-th percentile of the standard normal distribution.
We wish to test .
When , then formula reduces to
where .
Value
required sample size per group
Note
The test is a two-sided test. For one-sided tests, please double the
significance level. For example, you can set alpha=0.10
to obtain one-sided test at 5% significance level.
Author(s)
Weiliang Qiu stwxq@channing.harvard.edu
References
Rosner, B. Fundamentals of Biostatistics. Sixth edition. Thomson Brooks/Cole. 2006.
See Also
ssLongFull
, powerLong
,
powerLongFull
.
Examples
# Example 8.33 on page 336 of Rosner (2006)
# n=85
ssLong(es=5/15, rho=0.7, alpha=0.05, power=0.8)