I am using this R code:
library(lmtest)
TS <- read.table('Test.txt', sep='\t', header=TRUE)
grangertest(X ~ Y, order = 3, data = TS)
grangertest(Y ~ X, order = 3, data = TS)
I am getting these results:
Granger causality test
Model 1: X ~ Lags(X, 1:3) + Lags(Y, 1:3)
Model 2: X ~ Lags(X, 1:3)
Res.Df Df F Pr(>F)
1 637
2 640 -3 11.032 4.546e-07 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
> grangertest(Y ~ X, order = 3, data = TS)
Granger causality test
Model 1: Y ~ Lags(Y, 1:3) + Lags(X, 1:3)
Model 2: Y ~ Lags(Y, 1:3)
Res.Df Df F Pr(>F)
1 637
2 640 -3 3.5013 0.01527 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Could someone please help me to interpret the results? Let us say my level of significance is 0.05. It appears that I can reject the null hypothesis of no Granger causality. Does this meas that there is evidence that X and Y above are linked/influence each other? Is there any directionality? A nice blog about the granger test can be found here btw.