Description Usage Arguments Details Value Examples
View source: R/mbecs_analyses.R
A helper function that extracts the variance components of linear mixed models, i.e., residuals, random-effects, fixed-effects, scales them to sample-size and returns a list of components.
1 | mbecMixedVariance(model.fit)
|
model.fit |
A linear mixed model object of class 'lmerMod'. |
Uses 'lme4::VarCorr' to extract Residuals and random-effects components. Standard Deviation of Residuals is stored as 'sc' attribute in the output of 'VarCorr'.
Uses 'lme4::fixef' to extract fixed-effects components, i.e., parameter estimates. The attribute 'pp' of the model contains the dense model matrix for fixed-effects parameters (X). The fixed effects variance, sigma2f, is the variance of the matrix-multiplication beta times X (parameter vector by model matrix)
A named list, containing proportional variance for model terms that describe mixed effects.
1 2 3 4 | # This will return the variance of random/mixed components.
limimo <- lme4::lmer(dummy.list$cnts[,1] ~ group + (1|batch),
data=dummy.list$meta)
list.variance <- mbecMixedVariance(model.fit=limimo)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.