For example, this is the data I have. I want to convert this weekly data into monthly data by weighted averages of interest. The thing is that some of the 7 day X1 data will overlap from one month to the other.
Week interest Start End
1 2004-01-04 - 2004-01-10 62 2004-01-04 2004-01-10
2 2004-01-11 - 2004-01-17 70 2004-01-11 2004-01-17
3 2004-01-18 - 2004-01-24 69 2004-01-18 2004-01-24
4 2004-01-25 - 2004-01-31 68 2004-01-25 2004-01-31
5 2004-02-01 - 2004-02-07 63 2004-02-01 2004-02-07
6 2004-02-08 - 2004-02-14 65 2004-02-08 2004-02-14
7 2004-02-15 - 2004-02-21 66 2004-02-15 2004-02-21
8 2004-02-22 - 2004-02-28 66 2004-02-22 2004-02-28
9 2004-02-29 - 2004-03-06 70 2004-02-29 2004-03-06
10 2004-03-07 - 2004-03-13 80 2004-03-07 2004-03-13
11 2004-03-14 - 2004-03-20 82 2004-03-14 2004-03-20
I tried to convert this data into daily data and then aggregate daily data into monthly data, but I don't know how to convert it. More specifically, a data frame looks like the following:
2004-01-04 62
2004-01-05 62
2004-01-06 62
...
2004-01-10 62
2005-01-11 70
....
...