alpha012_to_RandEff: Correlation structure: transform alpha to random effects

View source: R/helper_functions.R

alpha012_to_RandEffR Documentation

Correlation structure: transform alpha to random effects

Description

Correlation structure: transform alpha to 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.

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 matrices): random cluster intercept 'tau', random time effect 'gamma', random subject intercept and residual standard deviation

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 Sept. 20, 2023, 4:57 a.m.