As shown in the documentation, after running a vector autoregression model (VAR), one can continue with the causality command for Granger tests:
causality(x, cause = NULL, vcov.=NULL, boot=FALSE, boot.runs=100)
This is the example in the documentation,
data(Canada) # below is the data structure
> e prod rw U
>1980 Q1 929.6105 405.3665 386.1361 7.53
>1980 Q2 929.8040 404.6398 388.1358 7.70
>1980 Q3 930.3184 403.8149 390.5401 7.47
>1980 Q4 931.4277 404.2158 393.9638 7.27
>1981 Q1 932.6620 405.0467 396.7647 7.37
var.2c <- VAR(Canada, p = 2, type = "const")
causality(var.2c, cause = "e")
which returns
$Granger
Granger causality H0: e do not Granger-cause prod rw U
data: VAR object var.2c
F-Test = 6.2768, df1 = 6, df2 = 292, p-value = 3.206e-06
My question is: what is this Granger test for and how to interpret it?
It says in the results that the null hypothesis is "H0: e do not Granger-cause prod rw U", does that mean it is testing whether e Granger causes prod, rw, U all at the same time with one p-value?
When using grangertest()
in R
, one always needs to specify both a cause and the dependent variable, so it is not entirely intuitive for me how causality()
works.
Best Answer
Basically, Granger causality $x \xrightarrow{Granger} y$ exists when using lags of $x$ next to the lags of $y$ for forecasting $y$ delivers better forecast accuracy than using only the lags of $y$ (without the lags of $x$).
You can find definitions and details in Wikipedia and in free textbooks and lecture notes online. There are also many examples on this site, just check the threads tagged with granger-causality.
You are right. Note that in a 4-variable VAR(2) model, testing whether one variables does not cause the other three amounts to testing $3 \times 2$ zero restrictions (three variables times two lags), and that is also what the test summary shows:
df1=6
.This is because in a $K$-variate system with $K>2$ there are many possible causal links. $x_i$ may cause $x_j$; $x_i$ may cause $x_j$ and $x_k$; $x_i$ and $x_j$ may cause $x_k$; etc. So the function requires you to specify precisely which causal link you want to examine.