Learn R Programming

sjmisc (version 1.2)

icc: Intra-Class-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).

Value

  • A numeric vector with all random intercept intraclass-correlation-coefficients.

References

  • 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 (http://dx.doi.org/10.1016/j.cct.2012.05.004{doi: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)
fit <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
icc(fit)

sleepstudy$mygrp <- sample(1:45, size = 180, replace = T)
fit <- lmer(Reaction ~ Days + (1|mygrp) + (Days | Subject), sleepstudy)
icc(fit)

Run the code above in your browser using DataLab