sandwich/ 0000755 0001762 0000144 00000000000 14535611613 012057 5 ustar ligges users sandwich/NAMESPACE 0000644 0001762 0000144 00000003620 14277043203 013274 0 ustar ligges users import("stats", "zoo")
importFrom("utils", "combn")
export(
## core ingredients
"sandwich",
"bread",
"meat",
## OPG estimator
"vcovOPG",
## HC estimators
"vcovHC",
"vcovHC.default",
"meatHC",
## clustered estimators
"vcovCL",
"meatCL",
## HAC estimators
"vcovHAC",
"vcovHAC.default",
"meatHAC",
"kernHAC",
"NeweyWest",
"weave",
## panel estimators
"vcovPL",
"meatPL",
## panel corrected estimators
"vcovPC",
"meatPC",
## clustered bootstrap (and jackknife) estimator
"vcovBS",
"vcovBS.default",
"vcovBS.lm",
".vcovBSenv",
"vcovJK",
## weights/bandwidths for HAC estimators
"weightsLumley",
"weightsAndrews",
"bwAndrews",
"bwNeweyWest",
## new estfun generic
"estfun",
## auxiliary functions
"kweights",
"lrvar",
"isoacf",
"pava.blocks"
)
## methods for extracting bread matrix
S3method("bread", "default")
S3method("bread", "lm")
S3method("bread", "mlm")
S3method("bread", "glm")
S3method("bread", "survreg")
S3method("bread", "coxph")
S3method("bread", "nls")
S3method("bread", "rlm")
S3method("bread", "clm")
S3method("bread", "polr")
S3method("bread", "gam")
S3method("bread", "hurdle")
S3method("bread", "zeroinfl")
S3method("bread", "mlogit")
## methods for empirical estimating functions
S3method("estfun", "lm")
S3method("estfun", "glm")
S3method("estfun", "mlm")
S3method("estfun", "survreg")
S3method("estfun", "coxph")
S3method("estfun", "nls")
S3method("estfun", "rlm")
S3method("estfun", "clm")
S3method("estfun", "polr")
S3method("estfun", "hurdle")
S3method("estfun", "zeroinfl")
S3method("estfun", "mlogit")
## methods for vcov*
S3method("vcovHC", "default")
S3method("vcovHC", "mlm")
S3method("vcovHAC", "default")
S3method("vcovBS", "default")
S3method("vcovBS", "lm")
S3method("vcovBS", "glm")
S3method("vcovJK", "default")
sandwich/README.md 0000644 0001762 0000144 00000002725 14272074171 013344 0 ustar ligges users
## 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:**
**Object-oriented implementation in R:**
``` 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
``` r
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
sandwich/data/ 0000755 0001762 0000144 00000000000 13005653110 012755 5 ustar ligges users sandwich/data/InstInnovation.rda 0000644 0001762 0000144 00001414750 13005653110 016443 0 ustar ligges users y Tǧd$$IJw03c-+TB!$JRiUi}mO|