Page 1 of 1

using dates in a FOR loop with unkown freq and smpl range

Posted: Tue May 31, 2011 9:12 am
by BBuser1
Eviews 7
What's the most efficient way to step through each data point within an unknown smpl of unknown frequency? For example: a loop that runs for each day of a D5 freq file over a 3 month smpl, or a loop that steps through each month of a monthly freq file over a two year smpl. The freq and smpl will be changing. Will a FOR loop recognize dates? I've tried several variations but can't get it to work. ! loops are integer-only and % loops work off lists?

Thanks.

Re: using dates in a FOR loop with unkown freq and smpl rang

Posted: Tue May 31, 2011 12:08 pm
by tchaithonov
The frequency part depends on the workpage, so in terms of the for loop, it's just add 1 (or if you use @dateadd, that would require a bit of work on the @pagefreq front). As to the duration of the smpl (3 months vs 2 years), could you find out from either the @pagesmpl or @smpl function in equation (if you are running one)?

Re: using dates in a FOR loop with unkown freq and smpl rang

Posted: Wed Jun 01, 2011 9:10 am
by EViews Gareth
Further to what has already been said, remember that you can use offsets in smpl commands too, so that you can do:

Code: Select all

smpl @first+10 @first+15
which will be the 11th through 16th observations, no matter what the frequency of the page is.

Also, you can use the @otod function to convert from observation number to dates.