Learn R Programming

robustlmm (version 3.5.0-2)

vcov.rlmerMod: Variance-covariance matrix of the fixed effects of an rlmerMod fit.

Description

By default returns the same object as lme4's vcov.merMod (the linearised model-based covariance). With type = "sandwich", returns the robust cluster-sandwich vcov_sandwich.

Usage

# S3 method for rlmerMod
vcov(
  object,
  type = c("default", "sandwich"),
  cluster = NULL,
  correction = c("G1", "none"),
  ...
)

Value

A \(p \times p\) covariance matrix for \(\hat{\beta}\).

Arguments

object

An rlmerMod object.

type

"default" (the lme4-inherited linearised vcov; the pre-existing behaviour) or "sandwich" (the robust cluster-sandwich).

cluster

When type = "sandwich", passed to vcov_sandwich: NULL (auto-detect for a single grouping factor), a character string naming a grouping factor of the model, or a length-n vector of cluster memberships.

correction

When type = "sandwich", "G1" (default, applies the \(J/(J-1)\) small-sample scaling) or "none".

...

Additional arguments passed to the default vcov method (only used when type = "default").

Details

The cluster sandwich is exact for a single (nested) grouping factor; for crossed factors it is approximate (a warning is issued, see vcov_sandwich).

Small-J caveat for the sandwich. The G1 correction is necessary but not sufficient at very small \(J\): in a simulation study sandwich CI coverage drops to ~0.89 at \(J = 8\) (vs. nominal 0.95). vcov_sandwich emits a warning for \(J < 20\); for inference at small \(J\) prefer type = "default" or pair the sandwich CI with a bootstrap calibration (e.g. confintROB).

See Also

vcov_sandwich