gicc: Generalized intraclass correlation coefficient for multilevel...

View source: R/gicc.R

giccR Documentation

Generalized intraclass correlation coefficient for multilevel data

Description

gicc facilitates the identification of between-subject variables versus balanced within-subject variables with hierarchical data. Methods handle factors, character variables and numerical variables. For categorical variables, Goodman-Kruskal's tau is returned and for numerical variables, the simple ICC with (variance between) / (variance between + variance within) applied to the rank (by default) of the variable. In either case, a value of 1 signifies a variable that is constant within clusters and a value of 0, a variable that is perfectly balanced within clusters, in the sense that within-cluster means are identical.

Usage

gicc(x, by, method, ...)

Arguments

x

a data frame, factor, character variable or a numerical variable.

by

if x is a data frame, by can be a formula (e.g. ~id) evaluated in x. Otherwise, by is a variable defining clusters.

method

a character string indicating whether to work with the rank of the raw variable, x, stripped of missing values, with the raw variable itself, or with is.na(x). Can be one of "rank", raw" or "na".

...

– not used

Value

a measure of relative variability within clusters so that 1 represents no variability and 0 perfect balance.

References

see p. 25 of Agresti (1990) Categorical Data Analysis, Wiley.

Examples

  gicc( hs, ~ school)
  gicc( hs, ~ school, method = 'raw')
  gicc( hs, ~ school/sex)

gmonette/spida2 documentation built on Aug. 11, 2024, 7:52 p.m.