Weekly returns from daily indexes

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

MSQ1
Posts: 13
Joined: Fri Sep 17, 2010 7:18 am

Weekly returns from daily indexes

Postby MSQ1 » Mon Aug 27, 2012 7:05 am

I'm trying to do something as simple as calculating weekly returns from daily indexes. I want the returns Wednesday to Wednesday but I will not know what weekday the data starts on (it will be different for different sample periods) so I can't use a simple loop. I've used the weekday function and then set the sample to include only Wednesdays (smpl day=3). But when calculating returns as return/return(-1)-1 the program still calculates daily returns but only on Wednesdays. What am I doing wrong?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Re: Weekly returns from daily indexes

Postby EViews Gareth » Mon Aug 27, 2012 8:05 am

If you're in a daily file, then the lag operator will always remove one day, not one week. Either convert your data into a weekly file, or calculate returns using a 7 day (or 5 day) lag, rather than a 1 day lag.

MSQ1
Posts: 13
Joined: Fri Sep 17, 2010 7:18 am

Re: Weekly returns from daily indexes

Postby MSQ1 » Tue Aug 28, 2012 12:09 am

I can't use a 5-day lag because I specifically want Wednesdays and the data can start at any weekday. I tried converting the workfile into a weekly file but as far as I understood it then transforms the data by taking the average for example. I just want to keep the observations on Wednesdays exactly as they are and then delete all other observations, ending up with a weekly dataset. It seems pretty basic but I haven't been able to find a command that does that. What am I missing?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Re: Weekly returns from daily indexes

Postby EViews Gareth » Tue Aug 28, 2012 7:46 am

Set the sample to be all days other than Wednesday, kill off all the other values (i.e. set them equal to NA), then do the frequency conversion.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests