ICC1 and ICC2 computed from a lme() model.
ICC1.lme(dv, grp, data)ICC2.lme(dv, grp, data, weighted = FALSE)
ICC1 or ICC2
The dependent variable of interest
cluster or grouping variable
data.frame containing the data
Whether or not a weighted mean is used in calculation of ICC2
Thomas D. Fletcher t.d.fletcher05@gmail.com
If data used are attached, you will sometimes receive a warning that can be ignored. The warning states that the following variables ... are masked. This is because the function first attaches the data and then detaches it within the function.
First a lme() model is computed from the data. Then ICC1 is computed as \(t00/(t00 + siqma^2)\),
where t00 is the variance in intercept of the model and \(sigma^2\) is the residual variance for
the model. The ICC2 is computed by computing the ICC2 for each group \(t00/(t00 + sigma^2/nj)\)
where nj is the size of group j. The mean across all groups is then taken to be the ICC2.
However, one can specify that the mean should be weigted by group size such that larger groups
are given more weight. The calculation of the individual group ICC2 is done by Bliese's
gmeanrel
function. An alternate specification not used here,
but sometimes seen in the literature for ICC2 is to use the formula above for the total data
set, but replace nj with the average group size. This is the method used in Bliese's
mult.icc
.
Bliese, P. (2000). Within-group agreement, non-independence, and reliability: Implications for data aggregation and analysis. In K. J. Klein & S. W. J. Kozlowski (Eds.), Multilevel theory, research, and methods in organizations: Foundations, extensions, and new directions (pp. 349-381). San Francisco: Jossey-Bass.
ICC.CI
, mult.icc
, gmeanrel
library(nlme)
library(multilevel)
data(bh1996)
ICC1.lme(HRS, GRP, data=bh1996)
ICC2.lme(HRS, GRP, data=bh1996)
Run the code above in your browser using DataLab