Learn R Programming

clubSandwich (version 0.7.0)

Cluster-Robust (Sandwich) Variance Estimators with Small-Sample Corrections

Description

Provides several cluster-robust variance estimators (i.e., sandwich estimators) for ordinary and weighted least squares linear regression models, including the bias-reduced linearization estimator introduced by Bell and McCaffrey (2002) and developed further by Pustejovsky and Tipton (2017) . The package includes functions for estimating the variance- covariance matrix and for testing single- and multiple- contrast hypotheses based on Wald test statistics. Tests of single regression coefficients use Satterthwaite or saddle-point corrections. Tests of multiple- contrast hypotheses use an approximation to Hotelling's T-squared distribution. Methods are provided for a variety of fitted models, including lm() and mlm objects; glm(); geeglm() (from package 'geepack'); lm_robust(), lm_lin(), and iv_robust() (from package 'estimatr'); ivreg() (from package 'AER'); ivreg() (from package 'ivreg' when estimated by ordinary least squares); plm() (from package 'plm'); gls() and lme() (from 'nlme'); lmer() (from `lme4`); robu() (from 'robumeta'); rma.uni() and rma.mv() (from 'metafor'); and mmrm() (from 'mmrm').

Copy Link

Version

Install

install.packages('clubSandwich')

Monthly Downloads

13,643

Version

0.7.0

License

GPL-3

Maintainer

James Pustejovsky

Last Published

May 4th, 2026

Functions in clubSandwich (0.7.0)

vcovCR.mlm

Cluster-robust variance-covariance matrix for an mlm object.
vcovCR.rma.uni

Cluster-robust variance-covariance matrix for a rma.uni object.
vcovCR.robu

Cluster-robust variance-covariance matrix for a robu object.
vcovCR.lme

Cluster-robust variance-covariance matrix for an lme object.
vcovCR.lmerMod

Cluster-robust variance-covariance matrix for an lmerMod object.
vcovCR.mmrm

Cluster-robust variance-covariance matrix for an mmrm object.
vcovCR.plm

Cluster-robust variance-covariance matrix for a plm object.
vcovCR.rma.mv

Cluster-robust variance-covariance matrix for a rma.mv object.
vcovCR.lm_robust

Cluster-robust variance-covariance matrix for an estimatr::lm_robust object.
findCluster.rma.mv

Detect cluster structure of an rma.mv object
impute_covariance_matrix

Impute a block-diagonal covariance matrix
AchievementAwardsRCT

Achievement Awards Demonstration program
MortalityRates

State-level annual mortality rates by cause among 18-20 year-olds
Wald_test

Test parameter constraints in a fitted linear regression model
coef_test

Test all or selected regression coefficients in a fitted model
constraint_matrices

Create constraint matrices
conf_int

Calculate confidence intervals for all or selected regression coefficients in a fitted model
vcovCR.geeglm

Cluster-robust variance-covariance matrix for a geeglm object.
pattern_covariance_matrix

Impute a patterned block-diagonal covariance matrix
vcovCR

Cluster-robust variance-covariance matrix
vcovCR.lm

Cluster-robust variance-covariance matrix for an lm object.
linear_contrast

Calculate confidence intervals and p-values for linear contrasts of regression coefficients in a fitted model
vcovCR.iv_robust

Cluster-robust variance-covariance matrix for an estimatr::iv_robust object.
vcovCR.glm

Cluster-robust variance-covariance matrix for a glm object.
vcovCR.ivreg

Cluster-robust variance-covariance matrix for an ivreg object.
SATcoaching

Randomized experiments on SAT coaching
dropoutPrevention

Dropout prevention/intervention program effects
vcovCR.gls

Cluster-robust variance-covariance matrix for a gls object.