merMod
objects
are supported.
icc(x, ...)
merMod
-class).print
-method that prints the variance parameters using
the comp
-argument set to "var"
: print(x, comp = "var")
(see 'Examples'). The re_var
-function is a convenient wrapper.
The random effect variances indicate the between- and within-group
variances as well as random-slope variance and random-slope-intercept
correlation. The components are denoted as following:
Further helpful online-ressources:
re_var
library(lme4)
fit0 <- lmer(Reaction ~ 1 + (1 | Subject), sleepstudy)
icc(fit0)
fit1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
icc(fit1)
sleepstudy$mygrp <- sample(1:45, size = 180, replace = TRUE)
fit2 <- lmer(Reaction ~ Days + (1 | mygrp) + (Days | Subject), sleepstudy)
icc(fit2)
# return icc for all models at once
icc(fit0, fit1, fit2)
icc1 <- icc(fit1)
icc2 <- icc(fit2)
print(icc1, comp = "var")
print(icc2, comp = "var")
Run the code above in your browser using DataLab