A simple function for calculating intraclass correlation using lme4::lmer(). The formula follows the description provided on Wikipedia.

icc(x, group)

Arguments

x

Response variable.

group

Grouping variable.

Value

An estimate of intraclass correlation.