Hi,
I am trying to to make a loop where the name of the series is looped by an alpha series for the series names and a group for definition of the series. I can get the second half of this to work, but I am unable to find a way for the series names themselves to loop. Basically, I want to create a bunch of series prwds_*, prwdh_*, etc where * is iso country codes for about 62 countries. Here is an example of what I am trying:
for !j=1 to 62
series prpws_isocode(!j)= prpws_usd(!j) *xr_us(!j)
series prpwh_isocode(!j)= prpwh_usd(!j) *xr_us(!j)
series prchs_isocode(!j)= prchs_usd(!j) *xr_us(!j)
series prchh_isocode(!j)= prch_usd(!j) *xr_us(!j)
where isocode is my alpha series containing br, cl, etc
prpws_usd is a group containing pws_br, pws_cl, etc
xr_us is a group containing xrbrus, xrclus, etc
and the groups are all alphabatized by the country code, so the same element (ex: 3rd) in each group (or isocode series) all refer to the same country
Obviously, I know I can write out all 248 (62*4) series names by hand and just loop for the RH side, but I would really prefer to avoid this at all costs from both a time and an ability to change easily standpoint. Thanks for any help!
looping to create series names
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: looping to create series names
Code: Select all
for !j=1 to 62
%name = "prpws_" + isocode(!j)
series %name = prpws_usd(!j) *xr_us(!j)
Re: looping to create series names
Thanks a lot! I will give that a try.
Re: looping to create series names
Using the code you suggested, I am not getting the error:
Can not assign string expression to numeric variable in "SERIES %NAME =PRPWS_USD(1)*XR_US(1)"
Any suggestions?
Can not assign string expression to numeric variable in "SERIES %NAME =PRPWS_USD(1)*XR_US(1)"
Any suggestions?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: looping to create series names
Sorry, forgot the braces:
series {%name} = ....
series {%name} = ....
Re: looping to create series names
Thank you very much! I have it working now. Much appreciation!!!
Who is online
Users browsing this forum: No registered users and 2 guests
