On Mon, 2010-12-06 at 11:12 -0500, Allin Cottrell wrote:
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.
You are the best! ;-)
> > 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
One way could be to produce leads providing a negative number to the
lags function.
Ex. lags -2; x
Produces two leads: x(t+1) and x(t+2)
Indeed, this was the way I first tried to create leads in gretl, almost
guessing...;-)
Bye
Giuseppe