Gretl uses regression-based variant
of the test, which is what is recommended
everywhere
open smoke.gdt
m1 <- ols cigs const restaurn educ age agesq
uh = m1.$uhat
ols lincome const cigs educ age agesq uh
## Gretl use Chi squared test, so df. correction
eval ($coeff[6]/$stderr[6])^2*807/801
(In the case of F-test df. correction would be 802/801;
the reason: the auxiliary regression has one
regressor more, so one residuals df less)
We get 5.0097597, which is exactly what tsls outputs
Oleh
13 квітня 2016, 03:37:50, від "Javier García" <javier.garcia(a)ehu.eus>:
Hello everybody,
I am trying to perform the Hausman test within a instrumental variables context.
Using the smoke.gdt data from the Wooldridge's book, I regress the variable
called lincome on a constant, cigs, educ, age and agesq. In order to do this I apply
"instrumental variables->2sls", providing one instrument (in particular the
variable called restaurn) for cigs, a variable that we suspect that could be correlated
with the perturbation. As it can be seen below, the asymptotic test statistic is 5.00976.
However, if I do it manually (or using another program like Stata), that value is totally
different, getting 2.76 aproximately (the square of the estimates differences,
(0.00173057-(-0.0413845))^2, over the variances differences, 0.0260279^2-0.00171372^2).
What am I doing wrong? It could be a Gretl bug?
Thanks a lot in advance.
Javi
Model 1: OLS, using observations 1-807Dependent variable: lincome
coefficient std. error t-ratio p-value
----------------------------------------------------------- const 7.79544
0.170427 45.74 1.05e-225 *** cigs 0.00173057 0.00171372 1.010
0.3129 educ 0.0603605 0.00789834 7.642 6.10e-014 *** age
0.0576907 0.00764359 7.548 1.21e-013 *** agesq −0.000630589
8.33822e-05 −7.563 1.08e-013 ***
Mean dependent var 9.687315 S.D. dependent var 0.712695Sum squared resid
341.8539 S.E. of regression 0.652880R-squared 0.164978 Adjusted
R-squared 0.160813F(4, 802) 39.61341 P-value(F)
2.68e-30Log-likelihood −798.5010 Akaike criterion 1607.002Schwarz criterion
1630.469 Hannan-Quinn 1616.013
Model 2: TSLS, using observations 1-807Dependent variable: lincomeInstrumented:
cigs Instruments: const restaurn educ age agesq
coefficient std. error z p-value
--------------------------------------------------------- const 7.78114
0.228129 34.11 5.52e-255 *** cigs −0.0413845 0.0260279 −1.590
0.1118 educ 0.0400241 0.0161607 2.477 0.0133 ** age
0.0932076 0.0236787 3.936 8.27e-05 *** agesq −0.00104373 0.000272324
−3.833 0.0001 ***
Mean dependent var 9.687315 S.D. dependent var 0.712695Sum squared resid
611.6565 S.E. of regression 0.873306R-squared 0.024886 Adjusted
R-squared 0.020022F(4, 802) 22.62942 P-value(F)
9.92e-18Log-likelihood −7885.899 Akaike criterion 15781.80Schwarz criterion
15805.26 Hannan-Quinn 15790.81
Log-likelihood for income = −8614.4
Hausman test - Null hypothesis: OLS estimates are consistent Asymptotic test
statistic: Chi-square(1) = 5.00976 with p-value = 0.0252048
JAVIER GARCÍA
Departamento de Economía Aplicada III (Econometría y Estadística)
Facultad de Economía y Empresa (Sección Sarriko)
Avda. Lehendakari Aguirre 83
48015 BILBAO
T.: +34 601 7126 F.: +34 601 3754
www.ehu.es
ERNE! Baliteke mezu honen zatiren bat edo mezu osoa legez babestuta egotea.
Mezuak badu bere hartzailea. Okerreko helbidera heldu bada (helbidea gaizki idatzi,
transmisioak huts egin) eman abisu igorleari, korreo honi erantzunda. Kontuz! Mezua ez
bada zuretzat, ez erabili, ez zabaldu beste inori, ez kopiatu eta ez baliatu.
¡ATENCIÓN! Este mensaje contiene información privilegiada o confidencial a la que sólo
tiene derecho a acceder el destinatario. Si usted lo recibe por error le agradeceríamos
que no hiciera uso de la información y que se pusiese en contacto con el remitente.
E-mail hau inprimatu baino lehen egiaztatu inprimatzeko beharra.
Antes de imprimir este e-mail piense bien si es necesario hacerlo.
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users