r2_pve: Proportion of variance explained

View source: R/r2_pve.R

r2_pveR Documentation

Proportion of variance explained

Description

r2_pve calculates the proportional reduction in variance explained (PVE) by adding variables to a prior, nested model. The PVE is considered a local effect size estimate (Peugh, 2010; Raudenbush & Bryk, 2002).

Usage

r2_pve(model1, model2 = NULL)

Arguments

model1

Previous model, produced using the lme4::lmer() function. Usually, this is the null or unconditional model.

model2

Current model, produced using the lme4::lmer() function.

Value

Data frame containing the proportion of variance explained at each level

References

\insertRef

peugh2010mlmhelpr

\insertRef

raudenbush2002mlmhelpr

Examples

fit1 <- lme4::lmer(mathach ~ 1 + (1|id), data=hsb, REML=FALSE)
fit2 <- lme4::lmer(mathach ~ 1 + ses + (1|id), data=hsb, REML=FALSE)

r2_pve(fit1, fit2)

lrocconi/mlmhelpr documentation built on Dec. 9, 2024, 10:58 p.m.