artur bala | 22 May 2013 22:55
Favicon

on sample restriction

Dear all,
I use a sample restriction command into a "foreach" loop based on an index variable.
The problem arises when for a specific index variable the sample restriction leaves no observation and then the loop stops running notifying that no observation would be left.
I would expect/prefer that the loop keep running through the next value of the index variable instead of shutting down.
Is there any way to have the loop work beyond this "impediment"?
Best regards,
artur
<div>
    Dear all,<br>
        I use a sample restriction command into a "foreach" loop based
        on an index variable.<br>
        The problem arises when for a specific index variable the sample
        restriction leaves no observation and then the loop stops
        running notifying that no observation would be left. <br>
        I would expect/prefer that the loop keep running through the
        next value of the index variable instead of shutting down.<br>
        Is there any way to have the loop work beyond this "impediment"?<br>
        Best regards,<br>
        artur<br>
  </div>
Sudipta Mahapatra | 21 May 2013 11:30
Picon

Simultaneous Equation model

Hi,

I am new to Gretl and want to fit a set of simultaneous equations to a data set with parameter constraints of the type: a1/b1=a3/b3. Is there a way to do this in Gretl?

Thank you and best regards.

Sudipta Mahapatra

<div><div dir="ltr">
<div>Hi, <br><br>I am new to Gretl and want to fit a set of simultaneous equations to a data set with parameter constraints of the type: a1/b1=a3/b3. Is there a way to do this in Gretl?<br><br>
</div>
<div>Thank you and best regards.<br><br>
</div>
<div>Sudipta Mahapatra</div>
<br>
</div></div>
Pindar | 20 May 2013 12:41
Picon

Re: DPANEL and Sargan/Hansen test

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@...
> http://lists.wfu.edu/mailman/listinfo/gretl-users

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@...
> http://lists.wfu.edu/mailman/listinfo/gretl-users

Pindar | 19 May 2013 18:19
Picon

DPANEL and Sargan/Hansen test

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

<div>
    Hi,<br><br>
    I'm still trying to get a feeling for the dpanel gmm estimators.<br>
    When estimating this xtabond2 statement from Roodman (2006/2008) for
    abdata.gdt<br>
    "xtabond2 n L.n L(0/1).(w k) yr*, gmmstyle(L.(n w k)) ivstyle(yr*,
    equation(level)) robust small"<br>
    &nbsp;&nbsp;&nbsp; by<br>
    &lt;hansl&gt;<br>
    open abdata.gdt<br>
    dpanel 1; n const w w(-1) k k(-1) ; \<br>
    &nbsp; GMM(n,2,8) GMM(w,2,8) GMM(k,2,8) \<br>
    &nbsp; GMMlevel(w,1,1) GMMlevel(k,1,1) --time --sys<br>
    &lt;hansl&gt;<br><br>
    I came across a question concerning the Sargan/Hansen test of
    overid. restrictions.<br>
    In the gretl-guide on p.152 it is stated that "Specifically,
    xtabond2 computes both a &ldquo;Sargan<br>
    test&rdquo; and a &ldquo;Hansen test&rdquo; for overidentification, but what it calls
    the Hansen test is what DPD and<br>
    gretl call the Sargan test."<br><br>
    The Hansen test in this example does not reject the validity of the
    instruments while the Sargan does.<br><br>
    "Sargan test of overid. restrictions: chi2(100) = 186.90 Prob &gt;
    chi2 = 0.000<br>
    (Not robust, but not weakened by many instruments.)<br>
    Hansen test of overid. restrictions: chi2(100) = 110.70 Prob &gt;
    chi2 = 0.218<br>
    (Robust, but can be weakened by many instruments.)"<br><br>
    In gretl output however the result of the Sargan test is and not the
    Hansen test :<br>
    "Sargan over-identification test: Chi-square(100) = 154.808
    [0.0004]"<br><br>
    That's was quite a surprise for me.<br>
    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?<br><br>
    Cheers<br>
    Leon<br><br>
</div>
Antonio Elias | 19 May 2013 12:22
Picon

Question

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
<div><div dir="ltr">Hello all,<div>
<br><div>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?&nbsp;</div>
<div><br></div>
<div>Thank you very much,</div>
</div>
<div>Aefz</div>
</div></div>
Gabriela Nodari | 19 May 2013 04:14
Picon

IRF plot error

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
<div><div dir="ltr">
<div>Dear gretl users,&nbsp;</div>
<div><br></div>
<div>I have a problem with plotting IRFs of a SVAR model saved on the icon menu.&nbsp;</div>
<div>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(&amp;Mod,1,1) and I get the following message:</div>
<div><br></div>
<div>gretl version 1.9.12cvs</div>
<div>Current session: 2013-05-19 04:06</div>
<div>? IRFplot(&amp;SVARregs,2,1)</div>
<div>"snames": no such item</div>
<div>*** error in function IRFplot</div>
<div>&gt; snames = obj["snames"]</div>
<div><br></div>
<div>Error executing script: halting</div>
<div>&gt; IRFplot(&amp;SVARregs,2,1)</div>
<div><br></div>
<div>Any suggestion?&nbsp;</div>
<div><br></div>
<div>
Thanks in advance.</div>
<div>Gabriela</div>
</div></div>
Gabriela Nodari | 17 May 2013 18:39
Picon

Gnuplot save eps

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?

Thanks in advance!
Gabriela

<div>
<p dir="ltr">Dear gretl users, </p>
<p dir="ltr">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? </p>
<p dir="ltr">Thanks in advance! <br>
Gabriela</p>
</div>
artur tarassow | 17 May 2013 14:58

restrict --silent option

Hi,
in the following example, the "--silent" option does not work properly, as the output is still printed.

<hansl>
open hamilton.gdt --quiet
genr p = 100*(log(PZUNEW)-log(PZUNEW[1973:01]))
genr s = -100*(log(EXRITL)-log(EXRITL[1973:01]))
genr pf = 100*(log(PC6IT)-log(PC6IT[1973:01]))
set vecm_norm none
vecm 4 1 p s pf --crt --silent
restrict --full --silent
    b[1] = 1
end restrict
<\hansl>

Artur
<div><div dir="ltr">
<div>
<div>
<div>
<div>Hi,<br>
</div>in the following example, the "--silent" option does not work properly, as the output is still printed.<br><br>
</div>&lt;hansl&gt;<br>open hamilton.gdt --quiet<br>genr p = 100*(log(PZUNEW)-log(PZUNEW[1973:01]))<br>
genr s = -100*(log(EXRITL)-log(EXRITL[1973:01]))<br>genr pf = 100*(log(PC6IT)-log(PC6IT[1973:01]))<br>set vecm_norm none<br>vecm 4 1 p s pf --crt --silent<br>restrict --full --silent<br>&nbsp;&nbsp;&nbsp; b[1] = 1<br>end restrict<br>
</div>
&lt;\hansl&gt;<br><br>
</div>Artur<br>
</div></div>
Pindar | 17 May 2013 12:38
Picon

DPANEL time dummies and the dpdstyle

Hi there,

I have a panel of bank data for 12 years and investigate on the effect of interest rates on risk-taking.
Although every characteristic of the dataset says DPANEL I have some problems getting correct estimations.
The main problem is one of multicollinearity: The time dummies and two of my regressors lead to omitting two time dummies. Since not all of them are significant I could kick them out before and have the same time dummy specification through all models. The multicollinearity problems starts in FE estimation and stays in DPANEL.
Since including the significant time dummies is crucial, I started to replicate the --time switch.
This works for the GRTEL DPANEL method, but how to tell GRETL to perform --dpdstyle without the --time switch?
Is this possible?

Thanks in advance
Leon

<div>
    Hi there,<br><br>
    I have a panel of bank data for 12 years and investigate on the
    effect of interest rates on risk-taking.<br>
    Although every characteristic of the dataset says DPANEL I have some
    problems getting correct estimations.<br>
    The main problem is one of multicollinearity: The time dummies and
    two of my regressors lead to omitting two time dummies. Since not
    all of them are significant I could kick them out before and have
    the same time dummy specification through all models. The
    multicollinearity problems starts in FE estimation and stays in
    DPANEL.<br>
    Since including the significant time dummies is crucial, I started
    to replicate the --time switch.<br>
    This works for the GRTEL DPANEL method, but how to tell GRETL to
    perform --dpdstyle without the --time switch?<br>
    Is this possible?<br><br>
    Thanks in advance<br>
    Leon<br><br>
</div>
artur tarassow | 15 May 2013 10:46

$vecGamma accessor

Hi all,

I've noted that the $vecGamma accessor does not grab the coefficient of the exogenous unrestricted variables. See the example below:

<hansl>
open denmark.gdt
list ENDO = LRM LRY
list EXO = IBO IDE
list DEXO = diff(EXO)
list DEXO += lags(1,DEXO)

vecm 2 1 ENDO ; DEXO ; #optional:EXO
matrix gamma = $vecGamma
print gamma
<\hansl>

The coefficients for d_IBO_1 and d_IDE_1 are not in matrix gamma. Is this intended?

Artur
<div><div dir="ltr">
<div>
<div>
<div>
<div>
<div>Hi all,<br><br>
</div>I've noted that the $vecGamma accessor does not grab the coefficient of the exogenous unrestricted variables. See the example below:<br><br>
</div>&lt;hansl&gt;<br>
open denmark.gdt<br>list ENDO = LRM LRY<br>list EXO = IBO IDE<br>list DEXO = diff(EXO)<br>list DEXO += lags(1,DEXO)<br><br>vecm 2 1 ENDO ; DEXO ; #optional:EXO<br>matrix gamma = $vecGamma<br>print gamma<br>
</div>&lt;\hansl&gt;<br><br>
</div>The coefficients for d_IBO_1 and d_IDE_1 are not in matrix gamma. Is this intended?<br><br>
</div>Artur<br>
</div></div>
Henrique Andrade | 15 May 2013 04:34
Picon

Probit marginal effects

Dear Gretl Community,

I'm trying to replicate the slope calculations that Gretl exhibits on Probit
estimation. In most of the time I can replicate exactly the same numbers,
but there are some cases that I can not (i.e. the values are different).

Please take a look at the following Hansl code:

<hansl>

set messages off
set echo off

############ Ok! #############

open transport.gdt

probit auto autotime bustime

list lista = $xlist

loop foreach i lista --quiet
    series med_$i = mean($i)
endloop

list med_lista = med_*
matrix med_me_matrix = dnorm(lincomb(med_lista, $coeff))*$coeff'
matrix me = med_me_matrix[1,]

printf "\nMarginal effects:\n %12.6f \n", me

############ Not ok! #############

open greene19_1
probit GRADE GPA PSI

list lista = $xlist

loop foreach i lista --quiet
    series med_$i = mean($i)
endloop

list med_lista = med_*
matrix med_me_matrix = dnorm(lincomb(med_lista, $coeff))*$coeff'
matrix me = med_me_matrix[1,]

printf "\nThe marginal effects: %12.8f \n", me

</hansl>

Thanks in advance,
Henrique Andrade

Gmane