Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ICC

Intra-class correlation.


Description

ICC calculates the intra-class correlation (ICC) from a fitted hierarchical linear model using the 'nlme' or 'lme4' packages.

Usage

ICC(model, ...)

## S3 method for class 'lme'
ICC(model, ...)

## S3 method for class 'merMod'
ICC(model, ...)

Arguments

model

A fitted linear model of type 'lme' (nlme) or 'merMod' (lme4; linear, generalized, or nonlinear).

...

Not currently implemented; used to ensure consistency with S3 generic.

Details

The ICC is the proportion of variance that is between-person variance. For more information, see Hoyt & Kenny (2013).

Value

The intra-class correlation of the model.

Methods (by class)

  • lme: Intra-class correlation for lme (nlme).

  • merMod: Intra-class correlation for lmer (lme4).

Examples

# iris data, showing use with lme()
if (require(nlme, quietly=TRUE)) {
    model <- lme(Sepal.Width ~ 1, random=~1|Species, data=iris)
    ICC(model)  # .49 of variance is between-subjects
}

# iris data, showing use with lmer()
if (require(lme4, quietly=TRUE)) {
    model <- lmer(Sepal.Width ~ 1 + (1|Species), data=iris)
    ICC(model)  # .49 of variance is between-subjects
}

reghelper

Helper Functions for Regression Analysis

v1.0.2
GPL-3
Authors
Jeffrey Hughes [aut, cre]
Initial release
2021-02-19

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.