I want to convert daily market returns into weekly market returns. The weeks are defined in my dataset.
I use the following code:
Code:
gen log_daily_factor=log(1+vwretd) by quarter_date week, sort: egen weekly_vwretd=total(log_daily_factor) replace weekly_vwretd=(exp(weekly_vwretd)-1)
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(quarter_date week vwretd) 0 1 5.00e-06 0 1 .007798 0 1 -.004387 0 1 -.006302 0 2 -.003181 0 2 -.011428 0 2 -.00564 0 2 -.0051 0 2 .005763 0 3 .000083 0 3 -.00813 0 3 -.009778 0 3 -.002773 0 3 .00236 0 4 .003016 0 4 -.010267 0 4 .001585 0 4 -.002537 0 4 -.009772 0 4 -.009598 0 5 .005172 0 5 .015571 0 5 -.008165 0 5 -.000581 0 5 -.004769 0 6 -.009838 0 6 .008983 0 6 -.005426 0 6 -.004899 0 6 .004667 0 7 -.004849 0 7 -.008772 0 7 .006324 0 7 .013689 0 7 .00734 0 8 -.004927 0 8 -.002821 0 8 .004639 0 8 .004324 0 8 -.000621 0 9 -.001338 0 9 -.006937 0 9 -.015326 end format %tq quarter_date
I also need to calculate excess weekly returns as weekly returns - treasury bill (TB). The treasury bill is the 3-month TB. When I compared between weekly_vwretd and the 3-month TB, the former looks as if it is on a different scale. Should I multiply the weekly returns by 12 to be comparable to the three-month TB before I calculate the excess returns?
Thanks
0 Response to Is this correct for converting daily into weekly returns?
Post a Comment