Looping Series Name
Posted: Wed Nov 06, 2013 10:28 am
I am working on converting old Aremos command files into Eviews
This is the old command File:
for x=#names;
series emp|#x=(re3254a|#x+re3333a|#x+re3341a|#x+re3342a|#x+re3343a|#x+re3344a|#x+re3345a|#x+re3346a|#x+re3364a|#x+re3391a|#x+re5112a|#x+re5121a|#x+re517a|#x+re518a|#x+re5191a|#x+re5413a|#x+re5415a|#x+re5417a|#x+re6215a|#x);
end;
for x=#names;
for y=#naics;
series hi|#y|a|#x = re|#y|a|#x/reta|#x;
series justemp|#y|a|#x = re|#y|a|#x;
end;
end;
!need just sum employment by state to devise average yearly growth in high tech sector
for y=#naics;
series den|#y|us = re|#y|aus/retaus;
end;
for x=#names;
for y=#naics;
series qe|#y|a#x=(re|#y|a|#x/reta|#x)/(den|#y|us);
end;
end;
It seems like the #y and #x allow the program to run through the whole series with only one line of code.
The NAICS codes are: 3254 3333 3341 3342 3343 3344 3345 3346 3364 3391 5112 5121 5171 5172 5174 5179 5182 5191 5413 5415 5417 6215
The names are all 50 states.
Example of the mnemonic being read: RE3254AAL RE3254AAR RE3333AAL RE3333AAR. So this is the mnemonics for NAICS codes 3254 and 3333 for Arkansas and Alabama.
Do you know how I can run the program to create the results that run through every NAICS and State code, like the Aremos code does? I can only figure out how to write each one individually using series statements.
I have attempted to create a few loops, but I always get either syntax error or invalid string or scalar name.
This was one attempt for the first command:
for %State AL AK AZ AR CA CO CT DE FL GA HI ID IL IN IA KS KY LA ME MD MA MI MN MS MO MT NE NV NH NJ NM NY NC ND OH OK OR PA RI SC SD TN TX UT VT VA WA WV WI WY US
series employment{%State}=re3254a{%State}+re3333a{%State}+re3341a{%State}+re3342a{%State}+re3343a{%State}+re3344a{%State}+re3345a{%State}+re3346a{%State}+re3364a{%State}+re3391a{%State}+re5112a{%State}+re5121a{%State}+re517a{%State}+re518a{%State}+re5191a{%State}+re5413a{%State}+re5415a{%State}+re5417a{%State}+re6215a{%State}
next
This is using Eviews 8.
Thank you,
Kristen Keough
This is the old command File:
for x=#names;
series emp|#x=(re3254a|#x+re3333a|#x+re3341a|#x+re3342a|#x+re3343a|#x+re3344a|#x+re3345a|#x+re3346a|#x+re3364a|#x+re3391a|#x+re5112a|#x+re5121a|#x+re517a|#x+re518a|#x+re5191a|#x+re5413a|#x+re5415a|#x+re5417a|#x+re6215a|#x);
end;
for x=#names;
for y=#naics;
series hi|#y|a|#x = re|#y|a|#x/reta|#x;
series justemp|#y|a|#x = re|#y|a|#x;
end;
end;
!need just sum employment by state to devise average yearly growth in high tech sector
for y=#naics;
series den|#y|us = re|#y|aus/retaus;
end;
for x=#names;
for y=#naics;
series qe|#y|a#x=(re|#y|a|#x/reta|#x)/(den|#y|us);
end;
end;
It seems like the #y and #x allow the program to run through the whole series with only one line of code.
The NAICS codes are: 3254 3333 3341 3342 3343 3344 3345 3346 3364 3391 5112 5121 5171 5172 5174 5179 5182 5191 5413 5415 5417 6215
The names are all 50 states.
Example of the mnemonic being read: RE3254AAL RE3254AAR RE3333AAL RE3333AAR. So this is the mnemonics for NAICS codes 3254 and 3333 for Arkansas and Alabama.
Do you know how I can run the program to create the results that run through every NAICS and State code, like the Aremos code does? I can only figure out how to write each one individually using series statements.
I have attempted to create a few loops, but I always get either syntax error or invalid string or scalar name.
This was one attempt for the first command:
for %State AL AK AZ AR CA CO CT DE FL GA HI ID IL IN IA KS KY LA ME MD MA MI MN MS MO MT NE NV NH NJ NM NY NC ND OH OK OR PA RI SC SD TN TX UT VT VA WA WV WI WY US
series employment{%State}=re3254a{%State}+re3333a{%State}+re3341a{%State}+re3342a{%State}+re3343a{%State}+re3344a{%State}+re3345a{%State}+re3346a{%State}+re3364a{%State}+re3391a{%State}+re5112a{%State}+re5121a{%State}+re517a{%State}+re518a{%State}+re5191a{%State}+re5413a{%State}+re5415a{%State}+re5417a{%State}+re6215a{%State}
next
This is using Eviews 8.
Thank you,
Kristen Keough