0
$\begingroup$

I am trying to fit a vector autoregression model using library(vars) but I was not able to get it to work with HAC standard errors.

> Canada %>% as_tibble() %>% head()
# A tibble: 6 x 4
      e  prod    rw     U
  <dbl> <dbl> <dbl> <dbl>
1  930.  405.  386.  7.53
2  930.  405.  388.  7.70
3  930.  404.  391.  7.47
4  931.  404.  394.  7.27
5  933.  405.  397.  7.37
6  934.  404.  400.  7.13

Now I can run my VAR easily.

library(vars)
data(Canada)
myvar = VAR(Canada, p = 2, type = "const") 

However, running the granger causality tests with HAC standard errors does not work

> causality(myvar, 'e', vcov = vcovHAC)
Error in umat - res : non-conformable arrays

What should I do? HAC adjustement is really standard in the literature...

Thanks!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.