[Gretl-users] Creating a series

Bulent Erdemir bulente at gmail.com
Wed Mar 28 18:52:47 EDT 2012


Hi,

I'd like to create a series of which an observation will refer to (or will
be calculated using) the previous observation of the same series.

For example, I want to end up with a series like below:

0
5
10
15
20
25
30

Is it possible to create this series with a command similar to:

series s = s(-1) + 5

(Of course, this series can be generated by a formula like obs * 5 but this
is not what I meant.)

In such a command, one observation will be calculated by a function which
receives the previous observation.

The command above wouldn't compile with error "The symbol 's' is undefined"
because at the time of the declaration there's no variable as s.

Could you recommend a solution ?

Best regards,
Bulent Erdemir
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wfu.edu/pipermail/gretl-users/attachments/20120329/d5465e12/attachment.html 


More information about the Gretl-users mailing list