Learn R Programming

SteppedPower (version 0.3.4)

alpha012_to_RandEff: Correlation structure: transform alpha to random effects

Description

Correlation structure: transform alpha to random effects

Usage

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

Value

a list containing four named elements (possibly matrices): random cluster intercept `tau`, random time effect `gamma`, random subject intercept and residual standard deviation

Arguments

alpha012

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

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.

Examples

Run this code
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)

Run the code above in your browser using DataLab