Skip to content

sandwich

Robust Covariance Matrix Estimators

v3.1-1 · Sep 15, 2024 · GPL-2 | GPL-3

Description

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>.

Downloads

248.1K

Last 30 days

207th

703K

Last 90 days

2.7M

Last year

Trend: +5% (30d vs prior 30d)

CRAN Check Status

14 OK
Show all 14 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-macos-arm64 OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK

Check History

OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 27, 2026
ERROR 13 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Mar 24, 2026
ERROR r-devel-linux-x86_64-debian-gcc

examples

Running examples in ‘sandwich-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: lrvar
> ### Title: Long-Run Variance of the Mean
> ### Aliases: lrvar
> ### Keywords: regression ts
>
...[truncated]...
: 
  non-conformable arguments
Error in meatHAC(x, order.by = order.by, prewhite = prewhite, weights = weights,  : 
  VAR(1) prewhitening of estimating functions failed
Calls: lrvar -> kernHAC -> vcovHAC -> vcovHAC.default -> meatHAC
Execution halted
OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026

Reverse Dependencies (251)

Dependency Network

Dependencies Reverse dependencies zoo AER CADFtest COUNT DiDforBigData PeerPerformance RcmdrMisc cjoint dhglm evian gKRLS gfunctions gmm list mediation merDeriv +236 more reverse deps sandwich

Version History

new 3.1-1 Mar 10, 2026
updated 3.1-1 ← 3.1-0 diff Sep 14, 2024
updated 3.1-0 ← 3.0-2 diff Dec 10, 2023
updated 3.0-2 ← 3.0-1 diff Jun 14, 2022
updated 3.0-1 ← 3.0-0 diff May 17, 2021
updated 3.0-0 ← 2.5-1 diff Oct 1, 2020
updated 2.5-1 ← 2.5-0 diff Apr 6, 2019
updated 2.5-0 ← 2.4-0 diff Aug 16, 2018
updated 2.4-0 ← 2.3-4 diff Jul 25, 2017
updated 2.3-4 ← 2.3-3 diff Sep 23, 2015
updated 2.3-3 ← 2.3-2 diff Mar 25, 2015
updated 2.3-2 ← 2.3-1 diff Aug 23, 2014
updated 2.3-1 ← 2.3-0 diff Jul 19, 2014
updated 2.3-0 ← 2.2-10 diff Oct 4, 2013
updated 2.2-10 ← 2.2-9 diff Mar 28, 2013
updated 2.2-9 ← 2.2-8 diff Jan 13, 2012
updated 2.2-8 ← 2.2-7 diff Sep 27, 2011
updated 2.2-7 ← 2.2-6 diff Jun 6, 2011
updated 2.2-6 ← 2.2-5 diff Mar 2, 2010
updated 2.2-5 ← 2.2-4 diff Jan 14, 2010