Building Matrix Using the Dataset
by Henrique Andrade
Dear Gretl Users,
How can I build a matrix using all the series in a current
dataset when the series inside the dataset has missing
values?
I'm trying the following command:
matrix A = { dataset }
But this is not working.
Best,
Henrique C. de Andrade
Doutorando em Economia Aplicada
Universidade Federal do Rio Grande do Sul
www.ufrgs.br/ppge
14 years
Re: [Gretl-users] Bug with leads of first differences in panels?
by Allin Cottrell
On Mon, 6 Dec 2010, Giuseppe Vittucci wrote:
> Ok. I replicated the bug with the greenedataset.
> Try the following:
>
> open greene14_1.gdt # a panel dataset
> logs C
> diff l_C(+1)
> print l_C l_C1 d_l_C1 --byobs
Thanks, now I see your point. This is now fixed in CVS and
snapshots.
> > One point to note is that if you take the first difference of a
> > series previously defined as a lead you lose an observation
> > unnecessarily at the start of the data. You can preserve the extra
> > observation by doing, e.g.
> >
> > d_l_C1 = l_C(+1) - l_C
>
> Oh, thanks. I didn't realize it cause in DOLS you usually generate the
> same number of leads and lags and therefore it always happens to lose
> some initial and final observation.
>
> I was actually running the two commands this way because I needed an
> easy way to generate and control lags and leads of first differenced
> variables for DOLS.
> I thought the easiest way in gretl was:
>
> diff l_h(-2 to +2) l_sd(-2 to +2) l_sf(-2 to +2)
> ols l_tfp du_* l_h l_sd l_sf d_* --robust
>
> Indeed, if I first take differences:
>
> diff l_h l_sd l_sf
>
> One can easy generate lags (with the appropriate command), but not leads.
> Is there a better way to proceed?
Hmm, it might be nice to have a command or function that provides
lags and/or leads in the way that the lags command and function
work for lags only. It's a pity that we made the lag order the
first argument to "lags" -- otherwise we could have implemented
this as a simple extension of what we have already. I'll have to
think about this.
Allin Cottrell
14 years
Re: [Gretl-users] Bug with leads of first differences in panels?
by Allin Cottrell
On Sun, 5 Dec 2010, Giuseppe Vittucci wrote:
> I have a panel and I am trying to estimate a Dynamic OLS.
> So I generated leads and lags of the variables and then I took first
> differences.
> However, the program does not seem to properly deal with first
> differences of leads.
> Here is an example...
What version of gretl are you using? And is your dataset
recognized by gretl as a panel? (It should say "panel" in the
main window, under the listing of series.) I tried the following
and could not replicate the problem you describe:
open greene14_1.gdt # a panel dataset
logs C
series l_C1 = l_C(+1)
diff l_C1
print l_C l_C1 d_l_C1 --byobs
The series l_C1 and d_l_C1 both have missing values at the last
observation for each panel group, as expected.
One point to note is that if you take the first difference of a
series previously defined as a lead you lose an observation
unnecessarily at the start of the data. You can preserve the extra
observation by doing, e.g.
d_l_C1 = l_C(+1) - l_C
Allin Cottrell
14 years
Bug with leads of first differences in panels?
by Giuseppe Vittucci
I have a panel and I am trying to estimate a Dynamic OLS.
So I generated leads and lags of the variables and then I took first
differences.
However, the program does not seem to properly deal with first
differences of leads.
Here is an example:
Variable: ln_h.
I generate the one period lead:
genr ln_h1 = ln_h(+1)
and take first differences:
diff ln_h1
This is what the program produces:
ln_h ln_h1 d_ln_h1
AUS:1971 2.305979 2.300383
AUS:1972 2.300383 2.294755 -0.005628
AUS:1973 2.294755 2.289095 -0.005660
AUS:1974 2.289095 2.283402 -0.005692
...
AUS:2001 2.362927 2.367811 0.004884
AUS:2002 2.367811 2.372671 0.004860
AUS:2003 2.372671 2.377507 0.004836
AUS:2004 2.377507 -0.435318
AUT:1971 1.942189 1.937014
AUT:1972 1.937014 1.931811 -0.005202
AUS:2004 is correctly missing in ln_h1, but not so for d_ln_h1.
Indeed, instead of a missing value the program compute the difference
between AUT:1971 and AUS:2004
I can solve the problem restricting the sample, but this is probably a
bug.
See you
Giuseppe
14 years
Re: [Gretl-users] Lines for scatterplots
by Allin Cottrell
On Fri, 3 Dec 2010, Eloy A. Fisher Hogan wrote:
> Hello! I was wondering if you could link scatter data with lines
> for the plot output in gretl via the graphic editor, or if you
> need to do that only via the gnuplot commands?
Try the "Lines" tab in the GUI graph editor.
Allin Cottrell
14 years
Re: [Gretl-users] VAR - bug report
by Allin Cottrell
On Sat, 4 Dec 2010, Ofer Cornfeld wrote:
> Now, I attach two parts of scripts and the output of each of the
> scripts...
>
> Comparing the output of the unrestricted VAR for both versions shows the
> difference in the coefficients and the "shift" in results.
>
> As far as I can tell, Version A results are correct and Version B results
> are shifted.
You're right, thanks for the report. This is now fixed in CVS and
snapshots.
Allin Cottrell
14 years
Re: [Gretl-users] VAR - bug report
by Allin Cottrell
On Fri, 3 Dec 2010, Ofer Cornfeld wrote:
> There is a difference in the output for the UNRESTRICTED VAR between
> versions A and B below:
>
> 1) The first coefficient printed is always CONST regardless to location
> of 0 in the specification of the system
That is intended; the constant is always shifted to the first
position.
> 2) The coefficients seems to be shifted, so the const is the p_d
> parameter etc.
>
> Version A)...
If you reckon there's a problem, could you post an actual working
script? Your "Version A)" and "Version B)" as posted are in fact
identical, so it's hard to tell what the problem is.
Allin Cottrell
14 years
VAR - bug report
by Ofer Cornfeld
Hi,
There is a difference in the output for the UNRESTRICTED VAR between
versions A and B below:
1) The first coefficient printed is always CONST regardless to location
of 0 in the specification of the system
2) The coefficients seems to be shifted , so the const is the p_d
parameter etc.
The version I use is 1.9.3
With kind regards,
Ofer Cornfeld
Version A)
system method = fiml
equation p_d p_d(-1) d_d(-1) r(-1) 0
equation d_d p_d(-1) d_d(-1) r(-1) 0
equation r p_d(-1) d_d(-1) r(-1) 0
end system
restrict --quiet
1 - rho*b[1,2] - b[2,2] + b[3,2] = 0
-b[2,3] + b[3,3] - rho*b[1,3] = 0
-b[2,4] + b[3,4] - rho*b[1,4] = 0
end restrict
estimate method=film
Version B)
system method = fiml
equation p_d p_d(-1) d_d(-1) r(-1) 0
equation d_d p_d(-1) d_d(-1) r(-1) 0
equation r p_d(-1) d_d(-1) r(-1) 0
end system
restrict --quiet
1 - rho*b[1,2] - b[2,2] + b[3,2] = 0
-b[2,3] + b[3,3] - rho*b[1,3] = 0
-b[2,4] + b[3,4] - rho*b[1,4] = 0
end restrict
estimate method=fiml
14 years
Lines for scatterplots
by Eloy A. Fisher Hogan
Hello! I was wondering if you could link scatter data with lines for the plot output in gretl via the graphic editor, or if you need to do that only via the gnuplot commands?
Thanks!
EF
Saludos cordiales,
Eloy Fisher
New School for Social Research, Ph.D Student.
US Contact Information:
Mobile: (001) 917 - 674 - 5381
Clarorite (toll free from Panama): 202-0400 ext 65576
http://webspace.newschool.edu/~fishe248/index.html
Información de Contacto en Panamá:
Eloy Fisher a/c Telma Hogan
Apartado Postal 0819-03909
Panama, República de Panamá
Teléfono: (507) 230 - 2336
14 years
Re: [Gretl-users] Fixed effects regression with instrumented variables
by Allin Cottrell
On Wed, 1 Dec 2010, Yangbo Du wrote:
> Thank you very much for your response. Is long-differencing supported
> by gretl as well? I am trying to compare estimators for fixed effects,
> first differences, and long differences to check for the possibility of
> errors-in-variables.
You can difference in any way you like, e.g.
Dy = y - y(-10) # y_t - y_{t-10}
Dy = y - y[1] # y_t - y_1
Allin Cottrell
14 years