Rdecom: R-squared based on ANOVA decomposition in multilevel model

Description Usage Arguments Value References

View source: R/Rdecom.R

Description

Function that computes the R-squared measure based on ANOVA decomposition measure (Edoardo Costantini, 2018). The explained variance is split into the explained variance for level-1 (within subjects), for the level-2 (between subjects) and the total explained variance.

Usage

1
Rdecom(dat, y, grpid, cov, xvar1, xvar2 = NULL, fit)

Arguments

dat

data set

y

dependent variable of the multilevel model

grpid

group identity (cluster variable)

cov

covariates in the MLA model

xvar1

name of first time variable from the cyclic process

xvar2

name of optional second time variable from the cyclic process

fit

lmer or lmerTest object (fit multilevel model)

Value

vector containing three values, named: "level_1_R2","level_2_R2", "total_R2"

References

Constantini, E. (2018). R-squared measures in Multilevel Modeling: The undesirable property of negative R-squared values. Downloaded from http://arno.uvt.nl/show.cgi?fid=146739, August 21, 2019.


PeterVerboon/cyclicpkg documentation built on March 4, 2020, 1:27 p.m.