loop with string and scalar combined
Posted: Tue Mar 06, 2012 8:31 am
I am trying to do a loop that combines numeric scalars and strings - basically I want to associate month numbers with month names (ie 1 = jan, 2 = feb, etc.). I tried using the following two methods (one with one loop, one with two separate loops), but these crash Eviews. Is there a way to do this successfully?
Thank you in advance.
METHOD 1
for !mtnum %mtnam 1 jan 2 feb 3 mar
smpl if mt = {!mtnum} AND (yr = 2008 OR yr = 2009)
ism_nsa_adj = {%mtnam}
next
METHOD 2
for !mtnum 1 2 3
for %mtnam jan feb mar
smpl if mt = {!mtnum} AND (yr = 2008 OR yr = 2009)
ism_nsa_adj = {%mtnam}
next
next
Thank you in advance.
METHOD 1
for !mtnum %mtnam 1 jan 2 feb 3 mar
smpl if mt = {!mtnum} AND (yr = 2008 OR yr = 2009)
ism_nsa_adj = {%mtnam}
next
METHOD 2
for !mtnum 1 2 3
for %mtnam jan feb mar
smpl if mt = {!mtnum} AND (yr = 2008 OR yr = 2009)
ism_nsa_adj = {%mtnam}
next
next