Learn R Programming

merDeriv (version 0.2-5)

vcov.lmerMod: Extract Variance-Covariance Matrix of all Parameters for Linear Mixed Effects Models

Description

This function calculates the variance-covariance matrix for all parameters (fixed, random effect, and residual) in a linear mixed effects model of class lmerMod-class.

Usage

# S3 method for lmerMod
vcov(object, ...)

Value

A p by p variance-covariance matrix, where p

represents the number of parameters. If full = FALSE, returns the variance-covariance matrix of only fixed effect parameters. If full = TRUE , returns the variance-covariance matrix for all fitted parameters (including fixed effect parameters, random effect (co)variances, and residual variance. If information = "expected", the variance-covariance matrix is based on the inversion of Fisher information matrix. If information = "observed", the variance-covariance matrix is based on the observed Fisher information, which is the negative of Hessian matrix. If ranpar = "var", the random effects are parameterized as variance/covariance; If ranpar = "sd", the random effects are parameterized as standard deviation/correlation.

Arguments

object

An object of class lmerMod-class.

...

additional arguments, including full, information and ranpar (full = FALSE, information = "expected" and ranpar = "var" are default; see details).

References

Wang, T. & Merkle, E. C. (2018). Derivative Computations and Robust Standard Errors for Linear Mixed Effects Models in lme4. Journal of Statistical Software, 87(1), 1-16. tools:::Rd_expr_doi("10.18637/jss.v087.c01")

Examples

Run this code
if (FALSE) {
# The sleepstudy example
lme4fit <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy, REML = FALSE)

# variance covariance matrix for all parameters
vcov(lme4fit, full = TRUE, ranpar = "var")
}

Run the code above in your browser using DataLab