Examples for 'sandwich::vcovHAC'


Heteroscedasticity and Autocorrelation Consistent (HAC) Covariance Matrix Estimation

Aliases: vcovHAC vcovHAC.default meatHAC

Keywords: regression ts

### ** Examples

x <- sin(1:100)
y <- 1 + x + rnorm(100)
fm <- lm(y ~ x)
vcovHAC(fm)
            (Intercept)           x
(Intercept) 0.008636837 0.002263394
x           0.002263394 0.019421482
vcov(fm)
             (Intercept)            x
(Intercept) 9.567059e-03 2.420313e-05
x           2.420313e-05 1.903196e-02

[Package sandwich version 3.0-1 Index]