38.4 Standard Errors
sandwich
vignette
Type | Applicable | Usage | Reference |
---|---|---|---|
const |
Assume constant variances | ||
HC HC0 |
vcovCL |
Heterogeneity White’s estimator All other heterogeneity SE methods are derivatives of this. No small sample bias adjustment |
(White 1980) |
HC1 |
vcovCL |
Uses a degrees of freedom-based correction When the number of clusters is small, |
(J. G. MacKinnon and White 1985) |
HC2 |
vcovCL |
Better with the linear model, but still applicable for Generalized Linear Models Needs a hat (weighted) matrix |
|
HC3 |
vcovCL |
Better with the linear model, but still applicable for Generalized Linear Models Needs a hat (weighted) matrix |
|
HC4 |
vcovHC |
(Cribari-Neto 2004) | |
HC4m |
vcovHC |
(Cribari-Neto, Souza, and Vasconcellos 2007) | |
HC5 |
vcovHC |
(Cribari-Neto and Silva 2011) |
data(cars)
model <- lm(speed ~ dist, data = cars)
summary(model)
#>
#> Call:
#> lm(formula = speed ~ dist, data = cars)
#>
#> Residuals:
#> Min 1Q Median 3Q Max
#> -7.5293 -2.1550 0.3615 2.4377 6.4179
#>
#> Coefficients:
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 8.28391 0.87438 9.474 1.44e-12 ***
#> dist 0.16557 0.01749 9.464 1.49e-12 ***
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#>
#> Residual standard error: 3.156 on 48 degrees of freedom
#> Multiple R-squared: 0.6511, Adjusted R-squared: 0.6438
#> F-statistic: 89.57 on 1 and 48 DF, p-value: 1.49e-12
lmtest::coeftest(model, vcov. = sandwich::vcovHC(model, type = "HC1"))
#>
#> t test of coefficients:
#>
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 8.283906 0.891860 9.2883 2.682e-12 ***
#> dist 0.165568 0.019402 8.5335 3.482e-11 ***
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
References
Cameron, A Colin, Jonah B Gelbach, and Douglas L Miller. 2008. “Bootstrap-Based Improvements for Inference with Clustered Errors.” The Review of Economics and Statistics 90 (3): 414–27.
Cribari-Neto, Francisco. 2004. “Asymptotic Inference Under Heteroskedasticity of Unknown Form.” Computational Statistics & Data Analysis 45 (2): 215–33.
Cribari-Neto, Francisco, and Wilton Bernardino da Silva. 2011. “A New Heteroskedasticity-Consistent Covariance Matrix Estimator for the Linear Regression Model.” AStA Advances in Statistical Analysis 95: 129–46.
Cribari-Neto, Francisco, Tatiene C Souza, and Klaus LP Vasconcellos. 2007. “Inference Under Heteroskedasticity and Leveraged Data.” Communications in Statistics—Theory and Methods 36 (10): 1877–88.
MacKinnon, James G, and Halbert White. 1985. “Some Heteroskedasticity-Consistent Covariance Matrix Estimators with Improved Finite Sample Properties.” Journal of Econometrics 29 (3): 305–25.
White, Halbert. 1980. “A Heteroskedasticity-Consistent Covariance Matrix Estimator and a Direct Test for Heteroskedasticity.” Econometrica: Journal of the Econometric Society, 817–38.