Learn R Programming

sjstats (version 0.10.2)

icc: Intraclass-Correlation Coefficient

Description

This function calculates the intraclass-correlation (icc) for random intercepts of mixed effects models. Currently, merMod and glmmTMB objects are supported.

Usage

icc(x, ...)

Arguments

x

Fitted mixed effects model (of class merMod or glmmTMB).

...

More fitted model objects, to compute multiple intraclass-correlation coefficients at once.

Value

A numeric vector with all random intercept intraclass-correlation-coefficients, or a list of numeric vectors, when more than one model were used as arguments. Furthermore, between- and within-group variances as well as random-slope variance are returned as attributes.

Details

The ICC is calculated by dividing the between-group-variance (random intercept variance) by the total variance (i.e. sum of between-group-variance and within-group (residual) variance). The calculation of the ICC for generalized linear mixed models with binary outcome is based on Wu et al. (2012). For Poisson multilevel models, please refere to Stryhn et al. (2006). Aly et al. (2014) describe computation of ICC for negative binomial models.

There is a 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:

  • Within-group (residual) variance: sigma_2

  • Between-group-variance: tau.00 (variation between individual intercepts and average intercept)

  • Random-slope-variance: tau.11 (variation between individual slopes and average slope)

  • Random-Intercept-Slope-covariance: tau.01

  • Random-Intercept-Slope-correlation: rho.01

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<U+2013>1528 (10.1177/0149206313478188)

  • Aly SS, Zhao J, Li B, Jiang J. 2014. Reliability of environmental sampling culture results using the negative binomial intraclass correlation coefficient. Springerplus [Internet] 3. Available from: http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3916583/

  • Grace-Martion K. The Intraclass Correlation Coefficient in Mixed Models, web

  • Hox J. 2002. Multilevel analysis: techniques and applications. Mahwah, NJ: Erlbaum

  • Rabe-Hesketh S, Skrondal A. 2012. Multilevel and longitudinal modeling using Stata. 3rd ed. College Station, Tex: Stata Press Publication

  • Raudenbush SW, Bryk AS. 2002. Hierarchical linear models: applications and data analysis methods. 2nd ed. Thousand Oaks: Sage Publications

  • Stryhn H, Sanchez J, Morley P, Booker C, Dohoo IR. 2006. Interpretation of variance parameters in multilevel Poisson regression models. Proceedings of the 11th International Symposium on Veterinary Epidemiology and Economics, 2006 Available at http://www.sciquest.org.nz/node/64294

  • Wu S, Crespi CM, Wong WK. 2012. Comparison of methods for estimating the intraclass correlation coefficient for binary responses in cancer prevention cluster randomized trials. Contempory Clinical Trials 33: 869-880 (10.1016/j.cct.2012.05.004)

Further helpful online-ressources:

See Also

re_var

Examples

Run this code
# NOT RUN {
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