Dears
I am trying to breakdown quarterly data into monthly data using R. I am not concerned about dates as I can generate a vector of months corresponding to values without problems. The problem is with the vector of values and imputing the missing data. See the example below:
Quarter Value
2010-Q1 10
2010-Q2 15
2010-Q3 18
2010-Q4 12
The new data set should look like the following
Month Value
2010-3 10
2010-4 11.67
2010-5 13.34
2010-6 15
2010-7 16
2010-8 17
2010-9 18
2010-10 16
2010-11 14
2010-12 12
Now, the months within each quarter are filled using the following formula
The first month of the quarter[i] = The previous quarter value [i-1] + ((The difference between the quarter [i] and [i-1])/3)
The second month of the quarter[i] = The previous quarter value [i-1] + 2*((The difference between the quarter [i] and [i-1])/3)
For example:
2020-Q1 = 10
2020-Q2 = 15
Difference/3 = 5/3
2020-April = 10 + diff
2020-May = 10 + 2*diff
2020-June = 15 (end of the quarter stays the same) or can be calculated as 10 + 3*diff
I am wondering how to generate a new variable that can break down the values as mentioned above.
Thanks