Den 06/11/2011 kl. 03.41 skrev Allin Cottrell:
On Sun, 6 Nov 2011, Andreas Noack Jensen wrote:
> I cannot get the internal t variable to work when data is yearly.
> Here is an example
>
> # The t valible works when e.g. data is quarterly
> nulldata 50
> setobs 4 1950:1 --time-series
> series tmp = (t > "1960:1")
>
> # But not for yearly data
> setobs 1 1950 --time-series
> series tmp = (t > "1960")
>
> Would it be easy to extend the behaviour to yearly data?
I'm afraid that the answer to that is No. With any frequency other
than annual data there is no ambiguity between a plain observation
number such as "23" and a time-series index such as "1970:1" (first
quarter of 1970) or "1970:01" (first month of 1970). But with annual
data there is perfect ambiguity between "1664" meaning the 1664th
observation and meaning the year 1664. Obviously, there are possible
heuristics we could employ, but these would be subject to error.
Good point. I was thinking that "t" was only referring to the time indices but
the User's Guide is clear enough on that.
I would suggest that a reasonable method is to define a variable
named "year", as in
genr year = time + 1950
and then use "year" rather than "t" in setting up series such as the
"tmp" that you specify above.
I agree. It is easy to do.
Allin Cottrell
_______________________________________________
Gretl-devel mailing list
Gretl-devel(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-devel
--
Andreas Noack Jensen
Ph.d.-stipendiat
Økonomisk Institut andreas.noack.jensen(a)econ.ku.dk
Københavns Universitet
http://www.econ.ku.dk/phdstudent/noack/
Øster Farimagsgade 5, bygning 26 Tlf.: 353 23094
1353 København K