varcomp.mer: Extracting variance components

View source: R/utility_functions.R

varcomp.merR Documentation

Extracting variance components

Description

This function extracts the variance components from a mixed/hierarchical linear model fit using lmer.

Usage

varcomp.mer(object)

Arguments

object

a fitted model object of class mer or lmerMod.

Value

A named vector is returned. sigma2 denotes the residual variance. The other variance components are names D** where the trailing digits specify the of that variance component in the covariance matrix of the random effects.

Author(s)

Adam Loy loyad01@gmail.com

Examples

data(sleepstudy, package = "lme4") 
fm1 <- lme4::lmer(Reaction ~ Days + (Days|Subject), sleepstudy)
varcomp.mer(fm1)

HLMdiag documentation built on June 8, 2025, 10:58 a.m.