Page 1 of 1

Weekly returns from daily indexes

Posted: Mon Aug 27, 2012 7:05 am
by MSQ1
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?

Re: Weekly returns from daily indexes

Posted: Mon Aug 27, 2012 8:05 am
by EViews Gareth
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.

Re: Weekly returns from daily indexes

Posted: Tue Aug 28, 2012 12:09 am
by MSQ1
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?

Re: Weekly returns from daily indexes

Posted: Tue Aug 28, 2012 7:46 am
by EViews Gareth
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.