vcov_sandwich: Robust cluster-sandwich covariance of the fixed effects of a...

View source: R/influence.R

vcov_sandwichR Documentation

Robust cluster-sandwich covariance of the fixed effects of a fitted rlmerMod object.

Description

Computes the robust score sandwich \hat{V}_{IF} = \hat{A}^{-1} \hat{B} \hat{A}^{-T}, where \hat{A} is the Schur-complement (marginal) Jacobian of the profiled \beta-score and \hat{B} = \sum_j s_j s_j^T sums the per-cluster \beta-score contributions s_j = \sum_{i \in j} x_i \psi_e(\hat{r}_i). Equal to the user-facing vcov(object, type = "sandwich").

Usage

vcov_sandwich(fit, cluster = NULL, correction = c("G1", "none"))

Arguments

fit

rlmerMod object.

cluster

Cluster specification; see resolveCluster.

correction

One of "G1" (default, applies J/(J-1)) or "none".

Details

Exact for a single (nested) grouping factor; approximate for crossed factors (a warning is issued via resolveCluster). With few clusters, set correction = "G1" (default) for the J/(J-1) small-sample scaling.

\hat{\sigma}, \hat{\theta} are held fixed (partial sandwich); the returned variance is the leading-order fixed-effects covariance.

Value

A p \times p covariance matrix for \hat{\beta}, with dimnames from the fixed-effect coefficient names and attribute "n.clusters".

See Also

vcov, caseweightIF


robustlmm documentation built on June 21, 2026, 5:12 p.m.