Learn R Programming

glmmTMB (version 1.1.13)

sandwich: Sandwich Estimator based on Bread and Meat Matrices

Description

This (simplified) method for a new S3 generic based on sandwich computes the sandwich estimator for a fitted glmmTMB model.

Usage

sandwich(x, ...)

# S3 method for default sandwich(x, ...)

# S3 method for glmmTMB sandwich(x, full = FALSE, cluster = getGroups(x), rawnames = FALSE, ...)

Value

A square matrix representing the sandwich estimator.

Arguments

x

a glmmTMB object fitted with ML (REML is not supported).

...

ignored by the glmmTMB method.

full

logical; if TRUE, return the full sandwich matrix including variance components, otherwise only the fixed effects part (if the model was fit with ML).

cluster

a factor indicating the cluster structure of the data.

rawnames

logical; if TRUE, keep the original names of the parameters as in the TMB object. By default, FALSE such that the names are sanitized to user friendly names.

Examples

Run this code
m <- glmmTMB(count ~ mined + (1 | site), data = Salamanders, family = nbinom1)
sandwich(m)
sandwich(m, full = TRUE)

Run the code above in your browser using DataLab