View source: R/helper_functions.R
RandEff_to_icc | R Documentation |
This function transforms standard deviations of random effects into intracluster correlation (ICC), cluster autocorrelation (CAC) and individual autocorrelation (IAC). It reproduces the formulae in Hooper et al. (2016).
RandEff_to_icc(sigResid, tau, gamma = 0, psi = 0)
sigResid |
Residual standard deviation on individual level |
tau |
standard deviation of random cluster intercept |
gamma |
standard deviation of random time effect |
psi |
standard deviation of random subject specific intercept |
The formulae used are
\sigma^2_{marg} = \sigma^2_{resid} + \tau^2 + \gamma^2 + \psi^2 \\[1ex]
ICC = \frac{\tau^2 + \gamma^2}{\sigma^2_{marg}} \\[1ex]
CAC = \frac{\tau^2}{\tau^2 + \gamma^2} \\[1ex]
IAC = \frac{\psi^2}{\sigma^2_{resid}+\psi^2}
a list containing four named elements (possibly vectors or matrices):
icc
intracluster correlation
cac
cluster autocorrelation
iac
individual autocorrelation
sigResid
Residual standard deviation on individual level
Hooper, R., Teerenstra, S., de Hoop, E., & Eldridge, S. (2016).
Sample size calculation for stepped wedge and other longitudinal cluster randomised trials.
Statistics in medicine, 35(26), 4718-4728. DOI: 10.1002/sim.7028
icc_to_RandEff()
, RandEff_to_alpha012()
or alpha012_to_RandEff()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.