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

CRAN

257.3K

Last 30 days

211th

827.9K

Last 90 days

2.9M

Last year

Trend: -12% (30d vs prior 30d)

r2u CRAN

1.6K

Last 30 days

4.9K

Last 90 days

18.6K

Last year

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

autoCRAN

33

Last 7 days

239

Last 30 days

11

All-time

⚠ Shared name: this package is also shipped elsewhere on openSUSE, so this count is not exclusive to autoCRAN (it is an upper bound).

CRAN Check Status

13 OK
Show all 13 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-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 13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Jun 27, 2026
WARNING 12 OK · 0 NOTE · 1 WARNING · 0 ERROR · 0 FAILURE Jun 14, 2026
WARNING r-release-linux-x86_64

re-building of vignette outputs

Error(s) in re-building vignettes:
  ...
--- re-building ‘sandwich-CL.Rnw’ using Sweave
Loading required package: geepack
Loading required package: lattice
Loading required package: lme4
Loading required package: Matrix
Loading required package: lmte
...[truncated]...
 ==> Fatal error occurred, no output PDF file produced!
--- failed re-building ‘sandwich.Rnw’

SUMMARY: processing the following files failed:
  ‘sandwich-CL.Rnw’ ‘sandwich-OOP.Rnw’ ‘sandwich.Rnw’

Error: Vignette re-building failed.
Execution halted
OK 13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Jun 8, 2026
ERROR 12 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Jun 7, 2026
ERROR r-devel-linux-x86_64-debian-gcc

PDF version of manual

Rd conversion errors:
Converting parsed Rd's to LaTeX .Warning in file(out, "wt") :
  cannot open file '/tmp/RtmpqDhURH/ltxc9e39593bbd24/vcovHAC.tex': No space left on device
Error in file(out, "wt") : cannot open the connection
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 (272)

Dependency Network

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

Version History

39 tracked
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