I have monthly serial in the format given below. It is based on the daily data, so that in each month every daily observation have same identification value for example 1 in month 1 and 2 in month 2 and so on. Now I want to generate another serial which could gave the same identification value to two months in a rolling manner. For example, it should give value 1 to observations in month 1 and in month 2, and should give value 2 to observations in month 2 and in month 3 and so on as shown below:
Similarly, I need to generate serial for 3, 4 months till 36 months. If anyone could give me the code for generating these serial. I would be grateful.
Mon_serial | New_ser1 | New_ser2 |
1 | 1 | |
1 | 1 | |
1 | 1 | |
1 | 1 | |
2 | 1 | 2 |
2 | 1 | 2 |
2 | 1 | 2 |
2 | 1 | 2 |
2 | 1 | 2 |
2 | 1 | 2 |
2 | 1 | 2 |
2 | 1 | 2 |
2 | 1 | 2 |
3 | 2 | |
3 | 2 | |
3 | 2 | |
3 | 2 | |
3 | 2 |
Comment