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
"for" to compute series backwards
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: "for" to compute series backwards
Something like this:
If all went well, test should equal y.
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)
Re: "for" to compute series backwards
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
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
Who is online
Users browsing this forum: No registered users and 2 guests
