alpha012_to_RandEff: Transform alpha to random effects

View source: R/helper_functions.R

alpha012_to_RandEffR Documentation

Transform alpha to random effects

Description

Transforms a correlation structure specified by \alpha_0, \alpha_1, \alpha_2 as defined in Li et al. (2018) into standard deviations of random effects.

Usage

alpha012_to_RandEff(alpha012, sigResid = NULL, sigMarg = NULL)

Arguments

alpha012

A vector or a list of length 3. Each list element must have the same dimension(s).

sigResid

Residual standard deviation on individual level. Either residual sd or marginal sd needs to be specified.

sigMarg

Marginal standard deviation on individual level. Either residual sd or marginal sd needs to be specified.

Value

a list containing four named elements (possibly vectors or matrices):

  • random cluster intercept tau,

  • random time effect gamma,

  • random subject intercept psi,

  • residual standard deviation sigResid.

References

Li, F., Turner, E. L., & Preisser, J. S. (2018).
Sample size determination for GEE analyses of stepped wedge cluster randomized trials.
Biometrics, 74(4), 1450-1458. DOI: 10.1111/biom.12918

See Also

RandEff_to_icc(), icc_to_RandEff() or RandEff_to_alpha012()

Examples

alpha012_to_RandEff(alpha012=c(.1,.1,.1), sigMarg=1)
alpha012_to_RandEff(alpha012=c(.1,.1,.1), sigResid=.9486833)

## The function is vectorised:
alpha012_to_RandEff(alpha012=list(matrix(c(0,.1,.1,.2), 2, 2),
                                  matrix(c(0,0,.1,.2) , 2, 2),
                                  matrix(c(0,0,.2,.2) , 2, 2)),
                    sigMarg=1)


PMildenb/SteppedPower documentation built on Nov. 24, 2024, 3:06 a.m.