powerLong.multiTime {powerMediation}R Documentation

Power calculation for testing if mean changes for 2 groups are the same or not for longitudinal study with more than 2 time points

Description

Power calculation for testing if mean changes for 2 groups are the same or not for longitudinal study with more than 2 time points.

Usage

powerLong.multiTime(es, m, nn, sx2, rho = 0.5, alpha = 0.05)

Arguments

es

effect size

m

number of subjects

nn

number of observations per subject

sx2

within subject variance

rho

within subject correlation

alpha

type I error rate

Details

We are interested in comparing the slopes of the 2 groups AA and BB:

β1A=β1B \beta_{1A} = \beta_{1B}

where

YijA=β0A+β1AxjA+ϵijA,j=1,,nn;i=1,,m Y_{ijA}=\beta_{0A}+\beta_{1A} x_{jA} + \epsilon_{ijA}, j=1, \ldots, nn; i=1, \ldots, m

and

YijB=β0B+β1BxjB+ϵijB,j=1,,nn;i=1,,m Y_{ijB}=\beta_{0B}+\beta_{1B} x_{jB} + \epsilon_{ijB}, j=1, \ldots, nn; i=1, \ldots, m

The power calculation formula is (Equation on page 30 of Diggle et al. (1994)):

power=Φ[z1α+mnnsx2es22(1ρ)] power=\Phi\left[ -z_{1-\alpha} + \sqrt{\frac{m nn s_x^2 es^2}{2(1-\rho)}} \right]

where es=d/σes=d/\sigma, dd is the meaninful differnce of interest, sigma2sigma^2 is the variance of the random error, ρ\rho is the within-subject correlation, and sx2s_x^2 is the within-subject variance.

Value

power

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

Diggle PJ, Liang KY, and Zeger SL (1994). Analysis of Longitundinal Data. page 30. Clarendon Press, Oxford

See Also

ssLong.multiTime

Examples

  # power=0.8
  powerLong.multiTime(es=0.5/10, m=196, nn=3, sx2=4.22, rho = 0.5, alpha = 0.05)

[Package powerMediation version 0.3.4 Index]