lme4 — lmer_vcov" />
lmer_vcov.Rd
The function lmer_vcov
conducts statistical inference for
fixed coefficients and standard deviations
and correlations of random effects structure of models fitted in the
lme4 package.
The function lmer_pool
applies the Rubin formula for inference
for fitted lme4 models for multiply imputed datasets.
lmer_vcov(object, level=.95, use_reml=FALSE, ...) # S3 method for lmer_vcov summary(object, digits=4, file=NULL, ...) # S3 method for lmer_vcov coef(object, ...) # S3 method for lmer_vcov vcov(object, ...) lmer_vcov2(object, level=.95, ...) lmer_pool( models, level=.95, ...) # S3 method for lmer_pool summary(object, digits=4, file=NULL, ...) lmer_pool2( models, level=.95, ...)
object | Fitted object in lme4 |
---|---|
level | Confidence level |
use_reml | Logical indicating whether REML estimates should be used for variance components (if provided) |
digits | Number of digits used for rounding in summary |
file | Optional file name for sinking output |
models | List of models fitted in lme4 for a multiply imputed dataset |
... | Further arguments to be passed |
List with several entries:
Parameter summary
Estimated parameters
Covariance matrix of estimates
Further values
if (FALSE) { ############################################################################# # EXAMPLE 1: Single model fitted in lme4 ############################################################################# library(lme4) data(data.ma01, package="miceadds") dat <- na.omit(data.ma01) #* fit multilevel model formula <- math ~ hisei + miceadds::gm( books, idschool ) + ( 1 + books | idschool ) mod1 <- lme4::lmer( formula, data=dat, REML=FALSE) summary(mod1) #* statistical inference res1 <- miceadds::lmer_vcov( mod1 ) summary(res1) coef(res1) vcov(res1) ############################################################################# # EXAMPLE 2: lme4 model for multiply imputed dataset ############################################################################# library(lme4) data(data.ma02, package="miceadds") datlist <- miceadds::datlist_create(data.ma02) #** fit lme4 model for all imputed datasets formula <- math ~ hisei + miceadds::gm( books, idschool ) + ( 1 | idschool ) models <- list() M <- length(datlist) for (mm in 1:M){ models[[mm]] <- lme4::lmer( formula, data=datlist[[mm]], REML=FALSE) } #** statistical inference res1 <- miceadds::lmer_pool(models) summary(res1) }