Am 23.03.2017 um 17:31 schrieb Giuseppe Vittucci:
Dear all,
I am trying to compute the pairwise Dumitrescu-Hurlin test (a
Granger-causality test for panel data) in gretl.
In order to do this, after having run a separate:
var # y1 y2
one for each cross-sectional unit in the panel, I need to retrieve the
value of the F-test for the null hypothesis that no lags of variable y2
(y1) are significant in the equation for variable y1 (y2).
gretl computes these Granger causality tests and shows them by default
after the command "var", but it seems that this value isn't stored in
any accessor...
Is there an easy way to retrieve it?
Not that I'm aware of (and I may be wrong and/or there may be a function
package for it, although I don't think so), but what about the following
workaround:
For a Granger causality test from x on y you don't need to estimate a
VAR, you only need the equation for y. So I would estimate the single
equation for y with OLS, including the relevant lags, and then testing
Granger causality with the "omit" command. Something like this:
list causelags = lags(p, x) # p is the lag order
list targetlags = lags(p, y)
ols y const targetlags causelags
omit causelags --test-only --silent
yxteststat = $test
yxpval = $pvalue
Of course if you want to test in both directions, you have to do this
workaround again for x on the LHS (possibly with a loop to avoid code
duplication).
hth,
sven