Hello
I would like to create new alpha variables with the for loop. However, this is prevented by the quotation marks. For example:
This code works fine:
for %k %j 1 20 2 30 3 40
series country{%k}={%j}
next
But I would like to have the names of the countries as string variables
alpha country1="belgium”
alpha country2="germany”
alpha country3="italy”
This code does not work:
for %k %j 1 belgium 2 germany 3 italy
alpha country{%k}="{%j}"
next
This code does not work either:
for %k %j 1 "belgium" 2 "germany" 3 "italy"
alpha country{%k}={%j}
next
And this code doesn't work either:
for %k %j 1 {"belgium"} 2 {"germany"} 3 {"italy"}
alpha country{%k}={%j}
next
Is there a solution that I am overlooking?
Thank you very much for your help!
Best regards,
Björn
for loop with strings and alpha series
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: for loop with strings and alpha series
Code: Select all
for %k %j 1 belgium 2 germany 3 italy
alpha country{%k}=%j
next
Who is online
Users browsing this forum: No registered users and 2 guests
