Learn R Programming

sjmisc (version 1.7)

icc: Intraclass-Correlation Coefficient

Description

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

Usage

icc(x, ...)

Arguments

x
Fitted mixed effects model (merMod-class).
...
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

Some notes on why the ICC is useful, based on Grace-Martin K: The Intraclass Correlation Coefficient in Mixed Models, http://www.theanalysisfactor.com/the-intraclass-correlation-coefficient-in-mixed-models/{web}:
  • It can help you determine whether or not a linear mixed model is even necessary. If you find that the correlation is zero, that means the observations within clusters are no more similar than observations from different clusters. Go ahead and use a simpler analysis technique.
  • It can be theoretically meaningful to understand how much of the overall variation in the response is explained simply by clustering. For example, in a repeated measures psychological study you can tell to what extent mood is a trait (varies among people, but not within a person on different occasions) or state (varies little on average among people, but varies a lot across occasions).
  • It can also be meaningful to see how the ICC (as well as the between and within cluster variances) changes as variable are added to the model.

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 (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/
  • 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 athttp://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)
  • http://stats.stackexchange.com/questions/18088/intraclass-correlation-icc-for-an-interaction/28100#28100{CrossValidated (2012)Intraclass correlation (ICC) for an interaction?
http://stats.stackexchange.com/questions/113577/interpreting-the-random-effect-in-a-mixed-effect-model/113825#113825{CrossValidated (2014) Interpreting the random effect in a mixed-effect model} http://stats.stackexchange.com/questions/67247/how-to-partition-the-variance-explained-at-group-level-and-individual-level/67356#67356{CrossValidated (2014) how to partition the variance explained at group level and individual level}

Examples

Run this code
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")

Run the code above in your browser using DataLab