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:
re_var
to print random effect variances and get_re_var
to get the values from a particular variance component.
## Not run:
# library(lme4)
# 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(fit1, fit2)
#
# icc1 <- icc(fit1)
# icc2 <- icc(fit2)
#
# print(icc1, comp = "var")
# print(icc2, comp = "var")## End(Not run)
Run the code above in your browser using DataLab