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

HLM_ICC_rWG

Tidy report of HLM indices: ICC(1), ICC(2), and rWG/rWG(J).


Description

Compute ICC(1) (non-independence of data), ICC(2) (reliability of group means), and rWG/rWG(J) (within-group agreement for single-item/multi-item measures) in multilevel analysis (HLM).

Usage

HLM_ICC_rWG(
  data,
  group,
  icc.var,
  rwg.vars = icc.var,
  rwg.levels = 0,
  nsmall = 3
)

Arguments

data

Data frame.

group

Grouping variable.

icc.var

Key variable for analysis (usually the dependent variable).

rwg.vars

Default is icc.var. It can be:

  • A single variable (single-item measure), then computing rWG.

  • Multiple variables (multi-item measure), then computing rWG(J), where J = the number of items.

rwg.levels

As rWG/rWG(J) compares the actual group variance to the expected random variance (i.e., the variance of uniform distribution, σ_EU^2), it is required to specify which type of uniform distribution is.

  • For continuous uniform distribution, σ_EU^2 = (max - min)^2 / 12. Then rwg.levels is not useful and will be set to 0 (the default).

  • For discrete uniform distribution, σ_EU^2 = (A^2 - 1) / 12, where A is the number of response options (levels). Then rwg.levels should be provided (= A in the above formula). For example, if the measure is a 5-point Likert scale, you should set rwg.levels=5.

nsmall

Number of decimal places of output. Default is 3.

Details

* Note for the following formulas
  • σ_u0^2: between-group variance (i.e., tau00)

  • σ_e^2: within-group variance (i.e., residual variance)

  • n_k: group size of the k-th group

  • K: number of groups

  • σ^2: actual group variance of the k-th group

  • σ_MJ^2: mean value of actual group variance of the k-th group across all J items

  • σ_EU^2: expected random variance (i.e., the variance of uniform distribution)

  • J: number of items

ICC(1) (intra-class correlation, or non-independence of data)

ICC(1) = var.u0 / (var.u0 + var.e) = σ_u0^2 / (σ_u0^2 + σ_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)) = Σ[σ_u0^2 / (σ_u0^2 + σ_e^2 / n_k)] / K

ICC(2) is a measure of "the representativeness of group-level aggregated means for within-group individual values" or "the degree to which an individual score can be considered a reliable assessment of a group-level construct".

rWG/rWG(J) (within-group agreement for single-item/multi-item measures)

rWG = 1 - σ^2 / σ_EU^2

rWG(J) = 1 - (σ_MJ^2 / σ_EU^2) / [J * (1 - σ_MJ^2 / σ_EU^2) + σ_MJ^2 / σ_EU^2]

rWG/rWG(J) is a measure of within-group agreement or consensus. Each group has an rWG/rWG(J).

Value

Invisibly return a list of results.

References

Bliese, P. D. (2000). Within-group agreement, non-independence, 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: Jossey-Bass, Inc.

James, L.R., Demaree, R.G., & Wolf, G. (1984). Estimating within-group 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  # 7-point 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)

bruceR

Broadly Useful Convenient and Efficient R Functions

v0.6.2
GPL-3
Authors
Han-Wu-Shuang Bao [aut, cre]
Initial release
2021-04-08

We don't support your browser anymore

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