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.
That said, I believe the results reported in the book are a little
weird: the OLS coefficients reported on page 451 (the ones you posted)
are different from the ones reported on page 336 (example 10.2), albeit
only at the sixth decimal digit. That makes me thing that Gujarati and
Porter may have used for the two tables two slightly different versions
of the same dataset (decimal digits, perhaps?), and the table on page
451 may be impossible to replicate with publicly available data.
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------