Learn R Programming

sjstats (version 0.2.0)

re_var: Random effect variances

Description

This function extracts the random effect variances as well as the random-intercept-slope-correlation of mixed effects models. Currently, only merMod objects are supported.

Usage

re_var(x)

Arguments

x
Fitted mixed effects model (merMod-class).

Value

NULL, as this is just a convenient print-wrapper for the variance components returned by the icc function.

References

Aguinis H, Gottfredson RK, Culpepper SA. 2013. Best-Practice Recommendations for Estimating Cross-Level Interaction Effects Using Multilevel Modeling. Journal of Management 39(6): 1490–1528 (\Sexpr[results=rd,stage=build]{tools:::Rd_expr_doi("#1")}10.1177/0149206313478188http://doi.org/10.1177/0149206313478188doi:\ifelse{latex}{\out{~}}{ }latex~ 10.1177/0149206313478188 )

See Also

icc and get_re_var

Examples

Run this code
library(lme4)
fit1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
re_var(fit1)

sleepstudy$mygrp <- sample(1:45, size = 180, replace = TRUE)
fit2 <- lmer(Reaction ~ Days + (1 | mygrp) + (Days | Subject), sleepstudy)
re_var(fit2)

Run the code above in your browser using DataLab