compute_icc: Intraclass Correlation Coefficient

Description Usage Arguments Examples

View source: R/compute_icc.r

Description

This function computes the intraclass correlation coefficients for one or several models.

Usage

1
2
3
4
5
6
7
8
compute_icc(
  ...,
  var_names = NULL,
  digits_icc = 2,
  digits_percent = 1,
  percent = TRUE,
  print = FALSE
)

Arguments

...

One or more objects of class lmer.

var_names

By default, the function extracts the name(s) of the dependent variable(s) from the objects. If you provide a vector with new names here, these new names will be used.

digits_icc

How many digits should be printed for the ICC (only works with print = TRUE)?

digits_percent

How many digits should be printed for the percentage (only works with print = TRUE)?

print

Logical value indicating whether the table should be formatted according to APA guidelines.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(lme4)
# Estimate a multilevel model
mod1 <- lmer(Reaction ~ 1 + (1 | Subject), sleepstudy)
mod2 <- lmer(Reaction ~ 1 + Days + (1 | Subject), sleepstudy)

# Computing the ICC for the first model
compute_icc(mod1, digits_icc = 4, digits_percent = 2, print = TRUE)

# Compute ICCs for both models
compute_icc(mod1, mod2)

masurp/pmstats documentation built on Oct. 6, 2020, 9:24 p.m.