View source: R/diary_functions.R
iccs_11 | R Documentation |
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.
iccs_11(data, vrb.nm, grp.nm, how = "lme", REML = FALSE)
data |
data.frame of data. |
vrb.nm |
character vector of colnames from |
grp.nm |
character vector of length 1 of a colname from |
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 |
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 |
double vector containing ICC(1, 1) of the vrb.nm
columns in
data
with names of the return object equal to vrb.nm
.
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,
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.