ICC {NormData}R Documentation

Intra class correlation

Description

The function ICC computes the intra class correlation. The ICC corresponds to the proportion of the total variance in the residuals that is accounted for by the clustering variable at hand (Kutner et al., 2005).

Usage

ICC(Cluster, Test.Score, Dataset, CI = 0.95)

Arguments

Cluster

The name of the clustering variable in the dataset.

Test.Score

The name of the outcome variable in the dataset (e.g., a test score).

Dataset

A dataset.

CI

The required confidence limits around the ICC. Default CI=.95, i.e. the 95 CI.

Details

This function is a modification of the ICCest function from the ICC package (v2.3.0), with minimal changes. For details of the original function, see https://cran.r-project.org/web/packages/ICC/ICC.pdf. The author of the original function is Matthew Wolak.

Value

An object of class ICC with component,

ICC

The intra class correlation coefficient.

LowerCI

The lower bound of the CI around the ICC.

UpperCI

The upper bound of the CI around the ICC.

Num.Clusters

The number of clusters in the dataset.

Mean.Cluster.Size

The mean number of observations per cluster.

Data

The dataset used in the analysis (observations with missing values are excluded).

N.Dataset

The sample size of the full dataset.

N.Removed

The number of observations that are removed due to missingness.

alpha

The specified \alpha-level for the CI, i.e., \alpha = 1 - CI.

Labels.Cluster

The labels of the clustering variable.

Author(s)

Original function: Matthew Wolak (with some small modifications by Wim Van der Elst)

References

https://cran.r-project.org/web/packages/ICC/ICC.pdf

Kutner, M. H., Nachtsheim, C. J., Neter, J., and Li, W. (2005). Applied linear statistical models (5th edition). New York: McGraw Hill.

Van der Elst, W. (2024). Regression-based normative data for psychological assessment: A hands-on approach using R. Springer Nature.

See Also

plot.ICC

Examples

# Compute ICC in Substitution dataset, using Test.Administrator as 
# clustering unit
data(Substitution)

# Add administrator to the dataset (just randomly allocate labels 
# as Test.Administrator, so ICC should be approx. 0)
Substitution$Test.Adminstrator <- NA
Substitution$Test.Adminstrator <- sample(LETTERS[1:10], 
  replace = TRUE, size = length(Substitution$Test.Adminstrator))
Substitution$Test.Adminstrator <- 
  as.factor(Substitution$Test.Adminstrator)

ICC_LDST <- ICC(Cluster = Test.Adminstrator, Test.Score = LDST, Data = Substitution)

# Explore results
summary(ICC_LDST)
plot(ICC_LDST)

[Package NormData version 1.1 Index]