On Tue, 7 Jan 2014, Riccardo (Jack) Lucchetti wrote:
On Tue, 7 Jan 2014, Lovrenc Pfajfar wrote:
> Dear Gretl-users,
>
> Can somebody tell me, how exactly (formula) is calculated Durbin's h
> statistic in Gretl.
http://gretl.cvs.sourceforge.net/viewvc/gretl/gretl/lib/src/modelprint.c?...
Line 692:
h = pmod->rho * sqrt(T / (1 - T * se * se));
where "T" is the number of observations, "pmod->rho" is the sample
1st
autocorrelation of the ols residuals and "se" is the estimated standard error
of the lagged dependent variable.
Actually there was a slight problem here: The "T" we've been using is the
number of observations minus 1, while it should just be the number of
observations. (Of course this makes no difference asymptotically.) This is
now fixed in CVS. Test script:
<hansl>
open data9-7
ols QNC 0 PRICE INCOME QNC(-1)
n = $T
se = $stderr[4]
h = $rho * sqrt(n/(1-n*se^2))
</hansl>
The manually calculated h should now agree with what gretl prints.
Allin Cottrell