Case-switch
Posted: Mon May 04, 2015 10:24 am
Hi there,
Just wondering what would be the easiest way to implement something akin to a switch-case statement in EViews. Is there some sort of dictionary or map function, or are nested if-statements the best option as in the code below?
Thanks in advance,
Michael
for %ind CN RL AU
if %ind="CN" then
%naics = "23"
else
if %ind="RL" then
%naics = "53"
else
if %ind="AU" then
%naics = "71"
endif
endif
endif
...
...
next
Just wondering what would be the easiest way to implement something akin to a switch-case statement in EViews. Is there some sort of dictionary or map function, or are nested if-statements the best option as in the code below?
Thanks in advance,
Michael
for %ind CN RL AU
if %ind="CN" then
%naics = "23"
else
if %ind="RL" then
%naics = "53"
else
if %ind="AU" then
%naics = "71"
endif
endif
endif
...
...
next