STATA - Rebalancing Quarterly - Date Variable

This forum made possible through the generous support of SDN members, donors, and sponsors. Thank you.

amazon1

New Member
7+ Year Member
Joined
Jul 10, 2014
Messages
1
Reaction score
0
Hi all,

I have about 8 years daily stock returns that I would like to transform to cumulative returns over a quarters.

I would like to create a variable "rebalancing" that is equal to the portfolio rebalancing date if the variable "date" <= to the next rebalancing date. Rebalancing happens 4 times a year from 2006 to 2014 at the following dates:
- February 15
- May 16th
- August 15th
- Nov 15th

Data look like that now:
date ret
15aug2006 .026666641
16aug2006 .043290105
17aug2006 -.020746967
18aug2006 -.008474569
21aug2006 -.002136699
22aug2006 -.008565302
23aug2006 .03671708
24aug2006 .024999974

I would like to get the following:
date rebalancing ret
9-Nov-10 15-Nov-10 -0.007201
10-Nov-10 15-Nov-10 -0.006551
11-Nov-10 15-Nov-10 -0.006594
12-Nov-10 15-Nov-10 -0.009246
15-Nov-10 15-Nov-10 -0.008615
16-Nov-10 15-Feb-11 -0.005672
17-Nov-10 15-Feb-11 0.003763
18-Nov-10 15-Feb-11 0.02104
19-Nov-10 15-Feb-11 0.008171

Thanks a lot for your help in advance!

Members don't see this ad.
 
Top