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.
using dates in a FOR loop with unkown freq and smpl range
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
tchaithonov
- Posts: 168
- Joined: Mon Apr 13, 2009 7:39 am
- Location: New York City
Re: using dates in a FOR loop with unkown freq and smpl rang
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)?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13585
- Joined: Tue Sep 16, 2008 5:38 pm
Re: using dates in a FOR loop with unkown freq and smpl rang
Further to what has already been said, remember that you can use offsets in smpl commands too, so that you can do:
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.
Code: Select all
smpl @first+10 @first+15
Also, you can use the @otod function to convert from observation number to dates.
Who is online
Users browsing this forum: No registered users and 2 guests
