Sorry for the confusing title to this thread. I have the following snippet of code:
for !i=2 to 12
genr gain_g{!i}_{%s}=g{!i}_{ %s}-g{!i-1}_{ %s}(-1)
next
where each gain_g!... series is previously created with NA values using "series". I want the loop to give them values as such:
gain_g2...=gain_g2-gain_g1...(-1).
However, specifying it as g{!i-1} gives me an error.
Any ideas?
Thanks,
BL
Recursive Problem in Integer-based loops
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Recursive Problem in Integer-based loops
Code: Select all
!j = !i-1
g{!j}
-
blonggovnl
- Posts: 16
- Joined: Thu Aug 22, 2013 7:45 am
Re: Recursive Problem in Integer-based loops
Hahaha clever. Thank you.
Who is online
Users browsing this forum: No registered users and 1 guest
