Page 1 of 1

Replacing for loops

Posted: Mon Oct 31, 2016 8:40 am
by weu39843
Hey guys,

I have monthly data from January 1981 till December 2016 (the format is "yyyy[M]MM"). Im running the following two for loops in order to analyze each point in time:

for !year = 1981 to 2016
for !month = 1 to 12
smpl !yearM!month !yearM!month if...(several conditions regarding the variables)
next
next

Is there a possibility to replace the two loops with one? For example, something like this:

for !date = 1981M1 to 2016M12 step 1
smpl !date !date if....
next

Thank you in advance!

Re: Replacing for loops

Posted: Mon Oct 31, 2016 9:20 am
by EViews Gareth
You're better off using the @otod and @dtoo functions to convert into observation space rather than dealing with dates.