Skip to content
/ sandwich Public

❗ This is a read-only mirror of the CRAN R package repository. sandwich — Robust Covariance Matrix Estimators. Homepage: https://sandwich.R-Forge.R-project.org/ Report bugs for this package: https://sandwich.R-Forge.R-project.org/contact.html

Notifications You must be signed in to change notification settings

cran/sandwich

Folders and files

NameName
Last commit message
Last commit date

Latest commit

8c1131d · Sep 16, 2024

History

38 Commits
Sep 16, 2024
Sep 16, 2024
May 18, 2021
Sep 16, 2024
Sep 16, 2024
Sep 16, 2024
Sep 16, 2024
Sep 16, 2024
Sep 16, 2024
Dec 12, 2023
Sep 16, 2024
Dec 12, 2023

Repository files navigation

Robust Covariance Matrix Estimators

Model-robust standard error estimators for cross-sectional, time series, clustered, panel, and longitudinal data. Modular object-oriented implementation with support for many model objects, including: lm, glm, fixest, survreg, coxph, mlogit, polr, hurdle, zeroinfl, and beyond.

Sandwich covariances for general parametric models:

Central limit theorem and sandwich estimator

Object-oriented implementation in R:

library("sandwich")
library("lmtest")
data("PetersenCL", package = "sandwich")
m <- lm(y ~ x, data = PetersenCL)
coeftest(m, vcov = sandwich)
## t test of coefficients:
## 
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   0.0297     0.0284    1.05      0.3    
## x             1.0348     0.0284   36.45   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
coeftest(m, vcov = vcovCL, cluster = ~ firm)
## t test of coefficients:
## 
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   0.0297     0.0670    0.44     0.66    
## x             1.0348     0.0506   20.45   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

About

❗ This is a read-only mirror of the CRAN R package repository. sandwich — Robust Covariance Matrix Estimators. Homepage: https://sandwich.R-Forge.R-project.org/ Report bugs for this package: https://sandwich.R-Forge.R-project.org/contact.html

Resources

Citation

Stars

Watchers

Forks

Packages

No packages published