Weekly returns from daily indexes
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
Weekly returns from daily indexes
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
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
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
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.
Who is online
Users browsing this forum: No registered users and 2 guests
