iccs_11 {quest}R Documentation

Intraclass Correlation for Multiple Variables for Multilevel Analysis: ICC(1,1)

Description

iccs_11 computes the intraclass correlation (ICC) for multiple variables based on a single rater with a single dimension, aka ICC(1,1). Traditionally, this is the type of ICC used for multilevel analysis where the value is interpreted as the proportion of variance accounted for by group membership. In other words, ICC(1,1) = the proportion of between-group variance; 1 - ICC(1,1) = the proportion of within-group variance.

Usage

iccs_11(data, vrb.nm, grp.nm, how = "lme", REML = FALSE)

Arguments

data

data.frame of data.

vrb.nm

character vector of colnames from data specifying the variable columns.

grp.nm

character vector of length 1 of a colname from data specifying the grouping column.

how

character vector of length 1 specifying how the ICC(1,1) should be calculated. There are four options: 1) "lme" uses a linear mixed effects model with the function lme from the package nlme, 2) "lmer" uses a linear mixed effects modeling with the function lmer from the package lme4, 3) "aov" uses a one-way analysis of variance with the function aov, and 4) "raw" uses the observed variances, which provides a biased estimate of the ICC(1,1) and is not recommended (It is only included for teaching purposes).

REML

logical vector of length 1 specifying whether restricted maximum likelihood estimation (TRUE) should be used rather than traditional maximum likelihood (FALSE). This is only applicable to linear mixed effects models when how is "lme" or "lmer".

Value

double vector containing ICC(1, 1) of the vrb.nm columns in data with names of the return object equal to vrb.nm.

See Also

icc_11 # ICC(1,1) for a single variable, icc_all_by # all six types of ICCs by group, lme # how = "lme" function, lmer # how = "lmer" function, aov # how = "aov" function,

Examples


tmp_nm <- c("outcome","case","session","trt_time")
dat <- as.data.frame(lmeInfo::Bryant2016)[tmp_nm]
stats_by <- psych::statsBy(dat,
   group = "case") # requires you to include "case" column in dat
iccs_11(data = dat, vrb.nm = c("outcome","session","trt_time"), grp.nm = "case")


[Package quest version 0.2.0 Index]