Am 15.03.2026 um 12:10 schrieb Riccardo (Jack) Lucchetti:
On 15/03/2026 05:50, Ramki S wrote:
> Dataset:
>
https://raw.githubusercontent.com/srk7774/data/refs/heads/master/table10....
>
>
>
> Hi,
>
> Is there anyway we can get newey-west standard errors in gretl? HAC
> robust errors are differing slightly with textbook result.
>
Hi, thanks for testing.
First of all, it must be said that, when it comes to robust
estimation, there are tons of slightly different ways to do things and
a single different detail can affect the results visibly (especially
in a small sample like the one you're considering). Take a look at
Chapter 22 of the gretl User's Guide. Judging by the formatting of the
output, it looks as if Gujarati and Porter are using Eviews; if that
was true, I don't know what the precise formulae Eviews used, so...
However, they seem to use a lag truncation parameter equal to 3,
rather than the automatic value used by gretl, which is 2 in this
case. You may want to use the "set hac_lag" command. But even in that
case, result don't match exactly, although they qualitatively do.
Just to add to that: there are several other settings in gretl that
affect those calculations, see the help for the "set" command -
hac_kernel, hac_prewhiten, hac_missvals. For example, it's not obvious
from the Eviews output which kernel was used there. For standard usage
those settings can be left at their defaults, but if you want to do
comparisons and replications, then it may be necessary to adjust them.
cheers
sven