bread.lmerMod: Extract Bread Component for Huber-White Sandwich Estimator of...

bread.lmerModR Documentation

Extract Bread Component for Huber-White Sandwich Estimator of Linear Mixed Effects Models

Description

This function calculates the bread component of the Huber-White sandwich estimator (variance covariance matrix multiplied by the number of clusters) for a linear mixed effects model of class lmerMod.

Usage

## S3 method for class 'lmerMod'
bread(x, ...)

Arguments

x

An object of class lmerMod.

...

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

Value

A p by p "bread" matrix for the Huber-White sandwich estimator (variance-covariance matrix multiplied by the number of clusters), 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.

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. doi: 10.18637/jss.v087.c01

Zeileis, A. (2006). Object-Oriented Computation of Sandwich Estimators. Journal of Statistical Software, 16(9), 1-16. https://www.jstatsoft.org/v16/i09/

Examples

## Not run: 
# The sleepstudy example
lme4fit <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy, REML = FALSE)

# bread component for all parameters
bread(lme4fit, full = TRUE, information = "expected", ranpar = "var")

## End(Not run)

nctingwang/merDeriv documentation built on Aug. 17, 2022, 3:06 p.m.