Learn R Programming

reghelper (version 1.1.2)

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 lme ICC(model, ...)

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

Value

The intra-class correlation of the 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.

Methods (by class)

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

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

Details

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

Examples

Run this code
# 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
}

Run the code above in your browser using DataLab