sandwich
Robust Covariance Matrix Estimators
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
257.3K
Last 30 days
211th
827.9K
Last 90 days
2.9M
Last year
Trend: -12% (30d vs prior 30d)
1.6K
Last 30 days
4.9K
Last 90 days
18.6K
Last year
Trend: +11.1% (30d vs prior 30d)
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
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
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
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
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