lme4 (version 1.0-5)

VarCorr: Extract Variance and Correlation Components

Description

This function calculates the estimated variances, standard deviations, and correlations between the random-effects terms in a mixed-effects model, of class merMod (linear, generalized or nonlinear). The within-group error variance and standard deviation are also calculated.

Usage

## S3 method for class 'merMod':
VarCorr(x, sigma, rdig)

Arguments

x
a fitted model object, usually an object inheriting from class merMod.
sigma
an optional numeric value used as a multiplier for the standard deviations. Default is 1.
rdig
an optional integer value specifying the number of digits used to represent correlation estimates. Default is 3.

Value

  • a list of matrices, one for each random effects grouping term. For each grouping term, the standard deviations and correlation matrices for each grouping term are stored as attributes "stddev" and "correlation", respectively, of the variance-covariance matrix, and the residual standard deviation is stored as attribute "sc" (for glmer fits, this attribute stores the scale parameter of the model).

See Also

lmer, nlmer

Examples

Run this code
data(Orthodont, package="nlme")
fm1 <- lmer(distance ~ age + (age|Subject), data = Orthodont)
VarCorr(fm1)

Run the code above in your browser using DataCamp Workspace