Learn R Programming

merDeriv (version 0.2-5)

bread.glmerMod: Extract Bread Component for Huber-White Sandwich Estimator of Generalized 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 generalized linear mixed effects model of class glmerMod-class.

Usage

# S3 method for glmerMod
bread(x, ...)

Value

A p by p "bread" matrix for the Huber-White sandwich estimator (variance-covariance matrix based on observed Fisher information 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 ranpar = "var", the random effects are parameterized as variance/covariance; If ranpar = "sd", the random effects are parameterized as standard deviation/correlation; If ranpar = "theta", the random effects are parameterized as components of Cholesky decomposition.

Arguments

x

An object of class glmerMod-class.

...

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

References

Douglas Bates, Martin Maechler, Ben Bolker, Steve Walker (2015). Fitting Linear Mixed-Effects Models Using lme4. Journal of Statistical Software, 67(1), 1-48. tools:::Rd_expr_doi("10.18637/jss.v067.i01").

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

Examples

Run this code
if (FALSE) {
# The cbpp example
data(finance, package = "smdata")

lme4fit <- glmer(corr ~ jmeth + (1 | item), data = finance,
                 family = binomial, nAGQ = 20)

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

Run the code above in your browser using DataLab