DPANEL and Sargan/Hansen test
by Pindar
Hi,
I'm still trying to get a feeling for the dpanel gmm estimators.
When estimating this xtabond2 statement from Roodman (2006/2008) for
abdata.gdt
"xtabond2 n L.n L(0/1).(w k) yr*, gmmstyle(L.(n w k)) ivstyle(yr*,
equation(level)) robust small"
by
<hansl>
open abdata.gdt
dpanel 1; n const w w(-1) k k(-1) ; \
GMM(n,2,8) GMM(w,2,8) GMM(k,2,8) \
GMMlevel(w,1,1) GMMlevel(k,1,1) --time --sys
<hansl>
I came across a question concerning the Sargan/Hansen test of overid.
restrictions.
In the gretl-guide on p.152 it is stated that "Specifically, xtabond2
computes both a "Sargan
test" and a "Hansen test" for overidentification, but what it calls the
Hansen test is what DPD and
gretl call the Sargan test."
The Hansen test in this example does not reject the validity of the
instruments while the Sargan does.
"Sargan test of overid. restrictions: chi2(100) = 186.90 Prob > chi2 = 0.000
(Not robust, but not weakened by many instruments.)
Hansen test of overid. restrictions: chi2(100) = 110.70 Prob > chi2 = 0.218
(Robust, but can be weakened by many instruments.)"
In gretl output however the result of the Sargan test is and not the
Hansen test :
"Sargan over-identification test: Chi-square(100) = 154.808 [0.0004]"
That's was quite a surprise for me.
Perhaps it's because the test statistic is not the same and it's really
the Hansen test (cos I believe in what u documented :-)), but why then
such drastic differences?
Cheers
Leon
11 years, 3 months
DPANEL user-guide a question
by Pindar
Hi there,
I have a question concerning p.146 in the user-guide:
Is this correct?
"dz = diff(z)
dpanel 1 ; y dz
dpanel 1 ; y dz ; GMM(*z*,0,0)"
Or should it be
dpanel 1 ; y dz ; GMM(*dz*,0,0)
It the first one is right, then it's because the differences of the
instruments are computed after using them as instruments,
while in the latter specification they are not altered any more.
I tried both variants in a few examples and found that the results of
dpanel 1 ; y dz
dpanel 1 ; y dz ; GMM(*dz*,0,0)
are very similar, but not the same, while
dpanel 1 ; y dz
dpanel 1 ; y dz ; GMM(*z*,0,0)
gives 'totally' different coeffietints and especially s.e. for dz.
I think it's quite crucial to understand this methodology and hence I'd
be happy for clarification.
Cheers
Leon
11 years, 4 months
boxplot issue: set xtics
by Artur Tarassow
Hi all,
I've got a problem with the following example
<hansl>
open greene12_1 --quiet
boxplot income accept --factorized --output=display \
{ set xtics ("NO" 0, "YES" 1) ; }
<\hansl>
which gives the error message: " got invalid field '{' "
Actually it should work, right?
Best,
Artur
11 years, 4 months
polynomial prediction
by aymen kaabi
hello.
is there any method of polynomial prediction in libgretl.
if yes please give me the name of a procedure.
thanks
11 years, 4 months
Bootstrap option after OLS model in Gretl-Gui
by JOSE FRANCISCO PERLES RIBES
Dear Gretl list
Trying to improve an estimated model by OLS with a small sample, I tried to do
a bootstrap on the coefficients and p-values after estimate by OLS model.
After reading the papers by John Fox "Bootstrapping Regression Models.
Appenix to an R and S-Plus Companion to applied regressions" and Mc.Kinnon "
Bootstrap methods in econometrics" I have seen that there are different
kinds of bootstrap procedures (I never think that they could be so many
bootstraps procedures).
I see in the gretl-GUI menu that after model estimation by OLS there is an
option that allows bootstrap confidence intervals of the coefficients of
the model, studentized intervals and p-value of the coefficients of the
model.
Of the options available in this menu and the information in Gretl guide, it
seems clear that this procedure is a "residual bootstrap" where the matrix of
regressors X is treated as fixed. Is there any way by GUI option to do a "
bootstrap case" where the regressors X are treated as "random"?. I have don
this exporting data to R and using Boot functions from package "car".
One more question, how are treated missing values generated by lagged
variables in the model in gretl bootrstrap procedure, are simply ignored?
And two last questions, do you think that this boostrap could be applicable
in the context of time series analysis, which is my case, or would be
better to use a blocking bootstrap? In this case, sombbody has script any
code to do this?
Thanks in advance and sorry for any inconvenience.
José Perles
University of Alicante
Spain.
11 years, 4 months
MA Rappesentation
by alexkakashi@libero.it
Dear all,
I have a question about AR models. Let us consider an AR(2), how can I obtain the MA rappresentation in gretl?
Thanks.
Alessandro Attanasio
11 years, 4 months
Fixed effect logit for panel datasets package error
by Antonio Elias
Hello Jack,
Thanks for your function package.
I replicated it and I got an error when declaring the bundles as follow
*bundle Qmats = null
*
*bundle b = null
*
*bundle qmats = null*
I change it for
*bundle Qmats
*
*bundle b
*
*bundle qmats*
and works perfectly.
Aefz
11 years, 4 months
Monte carlo with panel data
by Antonio Elias
Thank you sven. Firstly I define the size with "smpl" but after I have to
declare again that my data set is a panel.
2013/5/24 <gretl-users-request(a)lists.wfu.edu>
> Send Gretl-users mailing list submissions to
> gretl-users(a)lists.wfu.edu
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.wfu.edu/mailman/listinfo/gretl-users
> or, via email, send a message with subject or body 'help' to
> gretl-users-request(a)lists.wfu.edu
>
> You can reach the person managing the list at
> gretl-users-owner(a)lists.wfu.edu
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Gretl-users digest..."
>
>
> Today's Topics:
>
> 1. Re: Gretl-users Digest, Vol 76, Issue 25 (Sven Schreiber)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 24 May 2013 10:42:19 +0200
> From: Sven Schreiber <svetosch(a)gmx.net>
> Subject: Re: [Gretl-users] Gretl-users Digest, Vol 76, Issue 25
> To: gretl-users(a)lists.wfu.edu
> Message-ID: <519F27EB.2030506(a)gmx.net>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Am 24.05.2013 10:23, schrieb Antonio Elias:
> > I got an error because of using the command setobs in the loop to
> > re-define the size of my panel.
> >
>
>
> You probably want the "smpl" command. "setobs" is to define the
> structure of the data, not the sample.
>
> hth,
> sven
>
>
>
> ------------------------------
>
> _______________________________________________
> Gretl-users mailing list
> Gretl-users(a)lists.wfu.edu
> http://lists.wfu.edu/mailman/listinfo/gretl-users
>
> End of Gretl-users Digest, Vol 76, Issue 33
> *******************************************
>
11 years, 4 months
Re: [Gretl-users] Gretl-users Digest, Vol 76, Issue 25
by Antonio Elias
I got an error because of using the command setobs in the loop to re-define
the size of my panel.
Thank you very much,
Aefdz
2013/5/19 <gretl-users-request(a)lists.wfu.edu>
> Send Gretl-users mailing list submissions to
> gretl-users(a)lists.wfu.edu
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.wfu.edu/mailman/listinfo/gretl-users
> or, via email, send a message with subject or body 'help' to
> gretl-users-request(a)lists.wfu.edu
>
> You can reach the person managing the list at
> gretl-users-owner(a)lists.wfu.edu
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Gretl-users digest..."
>
>
> Today's Topics:
>
> 1. Re: Gnuplot save eps (Gabriela Nodari)
> 2. IRF plot error (Gabriela Nodari)
> 3. Re: Gnuplot save eps (Allin Cottrell)
> 4. Re: IRF plot error (Allin Cottrell)
> 5. Question (Antonio Elias)
> 6. Re: Question (Allin Cottrell)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sun, 19 May 2013 03:59:20 +0200
> From: Gabriela Nodari <gabriela.nodari(a)gmail.com>
> Subject: Re: [Gretl-users] Gnuplot save eps
> To: r.lucchetti(a)univpm.it, Gretl list <gretl-users(a)lists.wfu.edu>
> Message-ID:
> <
> CAHHsSo+UULz540n3VXTf2b7LoyMO8DTrmXa+WXBO7EV+3Q5taQ(a)mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Thank you for your answer.
> I got the output saved in eps format. However, it consists only of a part
> of the whole graph. I don't know what is going on. Could you please take a
> look to my code? The data reports IRFs results.
>
> Please notice that I have reduce the time horizon for ease of exposition,
> i.e. you will find "xrange" until 60, whereas I have reported here only 4
> point estimates per IRF.
>
> set term postscript eps "Times New Roman Bold,13" size 640,480
> set encoding utf8
> # user-defined plot
> set style line 1 lc rgb "#0000ff"
> set style line 2 lc rgb "#ff0021"
> set style line 3 lc rgb "#070d07"
> set style line 4 lc rgb "#e10c2c"
> set style line 5 lc rgb "#00cc00"
> set style line 6 lc rgb "#0000ff"
> set style line 8 lc rgb "#00fff2"
> set style increment user
> set yrange [-11.0976:2.30634]
> set xrange [0:60]
> set xlabel 'months'
> #set ylabel 'Industrial Production'
> set xzeroaxis
> set key right bottom
> set title ""
> set style fill solid 0.175
> set output '/Users/Gabriela/Desktop/IProb.eps'
> plot \
> '-' using 1:2:3 notitle w filledcurve, \
> 0 notitle w lines lt 0, \
> '-' using 1:($2) title "baseline" w lines lw 2, \
> '-' using 1:($2) title "S&P+VIX" w linespoints lw 2 pointinterval 4
> pointsize 1 pt 9 , \
> '-' using 1:($2) title "Confidence" w linespoints lw 2 pointinterval 4
> pointsize 1 pt 3, \
> '-' using 1:($2) title "Regulation" w linespoints lw 2 pointinterval 4
> pointsize 1 pt 13
> # baseline + conf. int
> 0 -1.85357 -0.0306622
> 1 -2.11585 -0.242486
> 2 -3.61335 -1.21308
> 3 -4.90273 -1.99271
> e
> 0 -0.985838
> 1 -1.24222
> 2 -2.53488
> 3 -3.67198
> e
> 0 -1.56746
> 1 -1.69876
> 2 -2.77689
> 3 -3.42978
> e
> 0 -0.918372
> 1 -1.05826
> 2 -2.23884
> 3 -3.21814
> e
> 0 -0.533756
> 1 -0.577218
> 2 -1.09126
> 3 -1.62523
> e
>
>
>
> 2013/5/17 Riccardo (Jack) Lucchetti <r.lucchetti(a)univpm.it>
>
> > On Fri, 17 May 2013, Gabriela Nodari wrote:
> >
> > Dear gretl users,
> >>
> >> I have modified the code of a graph generated by gretl. I am no more
> able
> >> to save this graph in eps format using menu options. Does someone know
> >> what
> >> I should write in the code to save this graph?
> >>
> >
> > See the help for "set terminal" and "set output". For example:
> >
> > <gnuplot>
> > set terminal eps
> > set output 'Moo.eps'
> > plot cos(x)
> > </gnuplot>
> >
> >
> > ------------------------------**-------------------------
> > 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<
> http://www2.econ.univpm.it/servizi/hpp/lucchetti>
> > ------------------------------**-------------------------
> > _______________________________________________
> > Gretl-users mailing list
> > Gretl-users(a)lists.wfu.edu
> > http://lists.wfu.edu/mailman/listinfo/gretl-users
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.wfu.edu/pipermail/gretl-users/attachments/20130519/539cfc1c/...
>
> ------------------------------
>
> Message: 2
> Date: Sun, 19 May 2013 04:14:13 +0200
> From: Gabriela Nodari <gabriela.nodari(a)gmail.com>
> Subject: [Gretl-users] IRF plot error
> To: Gretl list <gretl-users(a)lists.wfu.edu>
> Message-ID:
> <CAHHsSoLiEx30ryTsvUbx=BkaskhmdLuYFdmwE9A+7frYea=
> zQg(a)mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Dear gretl users,
>
> I have a problem with plotting IRFs of a SVAR model saved on the icon menu.
> Specifically, once I close a session (I mean closing gretl), after having
> estimated and saved a SVAR model via script, I am not able to plot its IRFs
> when I re-open the session. Even if the "bundle" is saved on the icon menu,
> I use a script to plot the IRFs (just using IRFplot(&Mod,1,1) and I get the
> following message:
>
> gretl version 1.9.12cvs
> Current session: 2013-05-19 04:06
> ? IRFplot(&SVARregs,2,1)
> "snames": no such item
> *** error in function IRFplot
> > snames = obj["snames"]
>
> Error executing script: halting
> > IRFplot(&SVARregs,2,1)
>
> Any suggestion?
>
> Thanks in advance.
> Gabriela
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.wfu.edu/pipermail/gretl-users/attachments/20130519/e2610c1e/...
>
> ------------------------------
>
> Message: 3
> Date: Sun, 19 May 2013 09:18:12 +0100 (BST)
> From: Allin Cottrell <cottrell(a)wfu.edu>
> Subject: Re: [Gretl-users] Gnuplot save eps
> To: Gretl list <gretl-users(a)lists.wfu.edu>
> Message-ID: <alpine.LNX.2.03.1305190915390.508(a)wfu.edu>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>
> On Sun, 19 May 2013, Gabriela Nodari wrote:
>
> > Thank you for your answer.
> > I got the output saved in eps format. However, it consists only of a part
> > of the whole graph. I don't know what is going on. Could you please take
> a
> > look to my code? The data reports IRFs results.
> >
> > Please notice that I have reduce the time horizon for ease of exposition,
> > i.e. you will find "xrange" until 60, whereas I have reported here only 4
> > point estimates per IRF.
> >
> > set term postscript eps "Times New Roman Bold,13" size 640,480
>
> You're asking here for a plot that's 640 x 480 inches (the
> inch being the default unit when specifying the size of an EPS
> plot). Make that something sane and you should be OK.
>
> More generally, in gnuplot, try "help postscript".
>
> Allin Cottrell
>
>
> ------------------------------
>
> Message: 4
> Date: Sun, 19 May 2013 10:58:44 +0100 (BST)
> From: Allin Cottrell <cottrell(a)wfu.edu>
> Subject: Re: [Gretl-users] IRF plot error
> To: Gretl list <gretl-users(a)lists.wfu.edu>
> Message-ID: <alpine.LNX.2.03.1305191053270.22176(a)wfu.edu>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>
> On Sun, 19 May 2013, Gabriela Nodari wrote:
>
> > I have a problem with plotting IRFs of a SVAR model saved on the icon
> menu.
> > Specifically, once I close a session (I mean closing gretl), after having
> > estimated and saved a SVAR model via script, I am not able to plot its
> IRFs
> > when I re-open the session. [...]
>
> This is likely to do with the fact that the "creator"
> information was not being recorded when a bundle was saved as
> part of a session file. That's now fixed in CVS and snapshots.
>
> I've verified that if I create a bundle using the "IS-LM"
> example SVAR script and save the gretl session, then on
> reopening the session file the bundle has a Graph menu and IRF
> plots can be drawn.
>
> Allin Cottrell
>
>
>
> ------------------------------
>
> Message: 5
> Date: Sun, 19 May 2013 12:22:46 +0200
> From: Antonio Elias <antonioefz91(a)gmail.com>
> Subject: [Gretl-users] Question
> To: gretl-users(a)lists.wfu.edu
> Message-ID:
> <
> CAHKMGVu_quAmH0LsJdxFfwCt1nrxa393-Esn2D6YQeU59E-q3w(a)mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hello all,
>
> Sorry if my question is stupid. I am an undergraduated student and I
> performaced a function with my own estimator for my final project. Now I
> would like to create a monte carlo silumation for testing the behaviour of
> my parameters but I read in the manual that a loop does not allow a
> function inside. Would be possible do it?
>
> Thank you very much,
> Aefz
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.wfu.edu/pipermail/gretl-users/attachments/20130519/b98d92c3/...
>
> ------------------------------
>
> Message: 6
> Date: Sun, 19 May 2013 12:04:37 +0100 (BST)
> From: Allin Cottrell <cottrell(a)wfu.edu>
> Subject: Re: [Gretl-users] Question
> To: Gretl list <gretl-users(a)lists.wfu.edu>
> Message-ID: <alpine.LNX.2.03.1305191159180.23035(a)wfu.edu>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>
> On Sun, 19 May 2013, Antonio Elias wrote:
>
> > Sorry if my question is stupid. I am an undergraduated student and I
> > performaced a function with my own estimator for my final project. Now I
> > would like to create a monte carlo silumation for testing the behaviour
> of
> > my parameters but I read in the manual that a loop does not allow a
> > function inside. Would be possible do it?
>
> You cannot _define_ a function inside a loop. But you can
> call a function from a loop just fine, which I presume is what
> you really want to do.
>
> <hansl>
> function scalar trivial (scalar x)
> return 2*x
> end function
>
> # main script
> loop i=1..10
> scalar k = trivial(i)
> endloop
> </hansl>
>
> Allin Cottrell
>
>
> ------------------------------
>
> _______________________________________________
> Gretl-users mailing list
> Gretl-users(a)lists.wfu.edu
> http://lists.wfu.edu/mailman/listinfo/gretl-users
>
> End of Gretl-users Digest, Vol 76, Issue 25
> *******************************************
>
11 years, 4 months
Re: [Gretl-users] DPANEL and Sargan/Hansen test
by Pindar
Am 20.05.2013 11:56, schrieb Sven Schreiber:
> Am 20.05.2013 11:52, schrieb Pindar:
>
>> Hola Rodrigo,
>>
>> The p-value for Hansen test is reported as " 0.218".
>> But with the output in the paper and gretl there are 3 different test
>> statistics for chi2(100):
>>
>> Sargan_xtabond2: 186.90
>> Sargan_gretl: 154.81
>> Hansen_xtabond2: 110.70
>>
>> I would like to be sure how to interpret differences in the diagnostic
>> checks between gretl and stata.
>>
> Yes, a useful question I think. But are the coeff estimates always the
> same, are you absolutely sure you are comparing identical
> specificiations? In panel settings and GMM settings there can be subtle
> differences.
Thanks Sven for pointing me to the 'always': The coefficients for the
const and the time dummies differ!
Trying to change the setting for the time dummies leads to 'completely
different' coefficients while
it does not alter the Sargan test statistic. I obviously failed in
replicating the time dummy instruments:
<hansl>
open abdata.gdt
genr time
genr timedum
list TD_roodman = dt_2 dt_3 dt_4 dt_5 dt_6 dt_7 dt_8
dpanel 1; n const w w(-1) k k(-1) TD_roodman ; \
GMM(n,2,8) GMM(w,2,8) GMM(k,2,8) \
GMMlevel(w,1,1) GMMlevel(k,1,1) TD_roodman --sys
# This estimation gives a 'Sargan test'
# Sargan over-identification test: Chi-square(100) = 154.367 [0.0004]
<hansl>
Best
Leon
Here the Roodman stata output of coefficients:
> cheers,
> sven
> _______________________________________________
> Gretl-users mailing list
> Gretl-users(a)lists.wfu.edu
> http://lists.wfu.edu/mailman/listinfo/gretl-users
11 years, 4 months