Page 1 of 1

"for" to compute series backwards

Posted: Wed Apr 28, 2010 8:04 am
by fmramos
Hi all!

I'm not used to loop routines. For the bellow task I usually compute with Excel easily.

I'd like to compute a series like:

y=y(1)/(1+dy/100)

y ~level; dy~an old series growth rate.

The original sample is 1991m1 to 2010m2. I have old growth rates backwards to 1901m01.

Does someone can help me?

Tks in advance,

Fabio

Re: "for" to compute series backwards

Posted: Wed Apr 28, 2010 8:42 am
by EViews Gareth
Something like this:

Code: Select all

!numofmonths = @datediff(@dateval("1990m12"), @dateval("1901m1"), "mm") for !i=!numofmonths to 0 step -1 smpl @first+!i @first+!i y = y(1)/(1+dy/100) next smpl @all series test = y(-1)*(1+dy(-1)/100)
If all went well, test should equal y.

Re: "for" to compute series backwards

Posted: Wed Apr 28, 2010 11:55 am
by fmramos
Tks Gareth, You're the man.

It worked with a little change ("+!i" by "-!i") cause I'd like to compute old data y by dy (1901/1990) in function of new data y (1991/2010).

Fabio