Package: sandwich 3.1-2

Achim Zeileis

sandwich: Robust Covariance Matrix Estimators

Object-oriented software for model-robust covariance matrix estimators. Starting out from the basic robust Eicker-Huber-White sandwich covariance methods include: heteroscedasticity-consistent (HC) covariances for cross-section data; heteroscedasticity- and autocorrelation-consistent (HAC) covariances for time series data (such as Andrews' kernel HAC, Newey-West, and WEAVE estimators); clustered covariances (one-way and multi-way); panel and panel-corrected covariances; outer-product-of-gradients covariances; and (clustered) bootstrap covariances. All methods are applicable to (generalized) linear model objects fitted by lm() and glm() but can also be adapted to other classes through S3 methods. Details can be found in Zeileis et al. (2020) <doi:10.18637/jss.v095.i01>, Zeileis (2004) <doi:10.18637/jss.v011.i10> and Zeileis (2006) <doi:10.18637/jss.v016.i09>.

Authors:Achim Zeileis [aut, cre], Thomas Lumley [aut], Nathaniel Graham [ctb], Susanne Koell [ctb]

sandwich_3.1-2.tar.gz
sandwich_3.1-2.zip(r-4.7)sandwich_3.1-2.zip(r-4.6)sandwich_3.1-2.zip(r-4.5)
sandwich_3.1-2.tgz(r-4.6-any)sandwich_3.1-2.tgz(r-4.5-any)
sandwich_3.1-2.tar.gz(r-4.7-any)sandwich_3.1-2.tar.gz(r-4.6-any)
sandwich_3.1-2.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
sandwich/json (API)

# Install 'sandwich' in R:
install.packages('sandwich', repos = c('https://r-forge.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://r-forge.r-project.org/projects/sandwich

Pkgdown/docs site:https://sandwich.r-forge.r-project.org

Datasets:

On CRAN:

Conda:

14.56 score 1.0k packages 10k scripts 255k downloads 35 mentions 33 exports 2 dependencies

Last updated from:e60afb1aa8. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK172
source / vignettesOK192
linux-release-x86_64OK179
macos-release-arm64OK110
macos-oldrel-arm64OK186
windows-develOK106
windows-releaseOK121
windows-oldrelOK102
wasm-releaseOK147

Exports:.vcovBSenvbreadbwAndrewsbwNeweyWestestfunisoacfkernHACkweightslrvarmeatmeatCLmeatHACmeatHCmeatPCmeatPLNeweyWestpava.blockssandwichvcovBSvcovBS.defaultvcovBS.lmvcovCLvcovHACvcovHAC.defaultvcovHCvcovHC.defaultvcovJKvcovOPGvcovPCvcovPLweaveweightsAndrewsweightsLumley

Dependencies:latticezoo

Econometric Computing with HC and HAC Covariance Matrix Estimators
Introduction | The linear regression model | Estimating the covariance matrix | Applications and illustrations | Summary | R code

Last update: 2026-04-07
Started: 2016-09-22

Various Versatile Variances: An Object-Oriented Implementation of Clustered Covariances in R
Introduction | Overview | Methods | Software | Illustrations | Simulation | Summary | Simulation results for panel data with AR(1) correlations

Last update: 2023-08-05
Started: 2017-02-23

Object-Oriented Computation of Sandwich Estimators
Introduction | Model frame | Existing R infrastructure | Covariance matrix estimators | Illustrations | Discussion

Last update: 2022-06-10
Started: 2016-09-22

Readme and manuals

Help Manual

Help pageTopics
Bread for Sandwichesbread bread.clm bread.coxph bread.default bread.gam bread.hurdle bread.lm bread.mlm bread.mlogit bread.nls bread.polr bread.rlm bread.survreg bread.zeroinfl
Extract Empirical Estimating Functionsestfun estfun.clm estfun.coxph estfun.glm estfun.hurdle estfun.lm estfun.mlm estfun.mlogit estfun.nls estfun.polr estfun.rlm estfun.survreg estfun.zeroinfl
Innovation and Institutional OwnershipInstInnovation
US Investment DataInvestment
Isotonic Autocorrelation Functionisoacf pava.blocks
Kernel Weightskweights
Long-Run Variance of the Meanlrvar
A Simple Meat Matrix Estimatormeat
Newey-West HAC Covariance Matrix EstimationbwNeweyWest NeweyWest
Petersen's Simulated Data for Assessing Clustered Standard ErrorsPetersenCL
US Expenditures for Public SchoolsPublicSchools
Making Sandwiches with Bread and Meatsandwich
(Clustered) Bootstrap Covariance Matrix Estimation.vcovBSenv vcovBS vcovBS.default vcovBS.glm vcovBS.lm
Clustered Covariance Matrix EstimationmeatCL vcovCL
Heteroscedasticity and Autocorrelation Consistent (HAC) Covariance Matrix EstimationmeatHAC vcovHAC vcovHAC.default
Heteroscedasticity-Consistent Covariance Matrix EstimationmeatHC vcovHC vcovHC.default vcovHC.mlm
(Clustered) Jackknife Covariance Matrix EstimationvcovJK vcovJK.default
Outer-Product-of-Gradients Covariance Matrix EstimationvcovOPG
Panel-Corrected Covariance Matrix EstimationmeatPC vcovPC
Clustered Covariance Matrix Estimation for Panel DatameatPL vcovPL
Kernel-based HAC Covariance Matrix EstimationbwAndrews kernHAC weightsAndrews
Weighted Empirical Adaptive Variance Estimationweave weightsLumley