Page 1 of 1

for loop and group

Posted: Tue May 19, 2009 2:48 pm
by Katjes
Hi, assuming that I define in for-loop several procedures. Then I want to group the outcome, including all countries as in the for-loop
simple example:
for %c USA GER
genr yoy_{%c}= GDP_{%c}-GDP_{%c}(-1)
next

and the next step should be something like:
group GDP GDP_{%c}
where all series defined in %c should be included, hence group GDP GDP_USA GDP_GER

Do you have some suggestions?

Re: for loop and group

Posted: Tue May 19, 2009 2:58 pm
by EViews Gareth
Not sure I follow exactly, but I think this is what you want:

Code: Select all

group GDP for %c USA GER genr yoy_{%c}= GDP_{%c}-GDP_{%c}(-1) gdp.add gdp_{%c} next

Re: for loop and group

Posted: Tue May 19, 2009 2:59 pm
by Katjes
Many thanks!