Skip to contents

This function calculates standardized beta coefficients from a fitted linear mixed-effects model (using the lmer function from the lme4 package). Standardized beta coefficients are obtained by scaling the fixed effects coefficients by the standard deviations of the predictor variables and the outcome variable.

Usage

std_beta_lmer(mod)

Arguments

mod

A fitted linear mixed-effects model object of class lmerMod, typically created with the lmer function from the lme4 package.

Value

A vector of standardized beta coefficients corresponding to the fixed effects (excluding the intercept) in the model.

Examples

library(lme4)
# Fit a linear mixed-effects model
mod <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
# Calculate standardized beta coefficients
std_beta_lmer(mod)
#>      Days 
#> 0.5352302