HLM_ICC_rWG {bruceR}  R Documentation 
Tidy report of HLM indices: ICC(1), ICC(2), and rWG/rWG(J).
Description
Compute ICC(1) (nonindependence of data),
ICC(2) (reliability of group means),
and r_{WG}
/r_{WG(J)}
(withingroup agreement for singleitem/multiitem measures)
in multilevel analysis (HLM).
Usage
HLM_ICC_rWG(
data,
group,
icc.var,
rwg.vars = icc.var,
rwg.levels = 0,
digits = 3
)
Arguments
data 
Data frame. 
group 
Grouping variable. 
icc.var 
Key variable for analysis (usually the dependent variable). 
rwg.vars 
Defaults to

rwg.levels 
As

digits 
Number of decimal places of output. Defaults to 
Details
 ICC(1) (intraclass correlation, or nonindependence of data)

ICC(1) = var.u0 / (var.u0 + var.e) =
\sigma_{u0}^2 / (\sigma_{u0}^2 + \sigma_{e}^2)
ICC(1) is the ICC we often compute and report in multilevel analysis (usually in the Null Model, where only the random intercept of group is included). It can be interpreted as either "the proportion of variance explained by groups" (i.e., heterogeneity between groups) or "the expectation of correlation coefficient between any two observations within any group" (i.e., homogeneity within groups).
 ICC(2) (reliability of group means)

ICC(2) = mean(var.u0 / (var.u0 + var.e / n.k)) =
\Sigma[\sigma_{u0}^2 / (\sigma_{u0}^2 + \sigma_{e}^2 / n_k)] / K
ICC(2) is a measure of "the representativeness of grouplevel aggregated means for withingroup individual values" or "the degree to which an individual score can be considered a reliable assessment of a grouplevel construct".
r_{WG}
/r_{WG(J)}
(withingroup agreement for singleitem/multiitem measures)
r_{WG} = 1  \sigma^2 / \sigma_{EU}^2
r_{WG(J)} = 1  (\sigma_{MJ}^2 / \sigma_{EU}^2) / [J * (1  \sigma_{MJ}^2 / \sigma_{EU}^2) + \sigma_{MJ}^2 / \sigma_{EU}^2]
r_{WG}
/r_{WG(J)}
is a measure of withingroup agreement or consensus. Each group has anr_{WG}
/r_{WG(J)}
.  * Note for the above formulas


\sigma_{u0}^2
: betweengroup variance (i.e., tau00) 
\sigma_{e}^2
: withingroup variance (i.e., residual variance) 
n_k
: group size of the kth group 
K
: number of groups 
\sigma^2
: actual group variance of the kth group 
\sigma_{MJ}^2
: mean value of actual group variance of the kth group across all J items 
\sigma_{EU}^2
: expected random variance (i.e., the variance of uniform distribution) 
J
: number of items

Value
Invisibly return a list of results.
References
Bliese, P. D. (2000). Withingroup agreement, nonindependence, and reliability: Implications for data aggregation and Analysis. In K. J. Klein & S. W. Kozlowski (Eds.), Multilevel theory, research, and methods in organizations (pp. 349–381). San Francisco, CA: JosseyBass, Inc.
James, L.R., Demaree, R.G., & Wolf, G. (1984). Estimating withingroup interrater reliability with and without response bias. Journal of Applied Psychology, 69, 85–98.
See Also
Examples
data = lme4::sleepstudy # continuous variable
HLM_ICC_rWG(data, group="Subject", icc.var="Reaction")
data = lmerTest::carrots # 7point scale
HLM_ICC_rWG(data, group="Consumer", icc.var="Preference",
rwg.vars="Preference",
rwg.levels=7)
HLM_ICC_rWG(data, group="Consumer", icc.var="Preference",
rwg.vars=c("Sweetness", "Bitter", "Crisp"),
rwg.levels=7)