I find an anomaly while generating monthly data. At the second step of my code, I see that 2019m11 and 2019m12 are missing.
Basically I am adding them manually, but I would like to understand why this is happening, and how to fix it.
Thank you for your time

My code is:
Code:
/* Step 1 */ gen date0 = yq(y, q) format date0 %tq drop y q rename date0 date tsset date, quarterly /* Step 2 */ gen mdate = mofd(dofq(date)) tsset mdate format mdate %tm tsfill sort mdate /* Step 3 */ gen logGDP = log(GDP) mipolate logGDP mdate, gen(logGDP2) pchip gen iGDP = exp(logGDP2) /* Step 4 */ drop GDP date logGDP logGDP2 rename mdate date rename iGDP GDP
Here is my data set:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int y byte q float GDP 2011 1 13024800 2011 2 14434822 2011 3 15745584 2011 4 16908796 2012 1 15182776 2012 2 16435996 2012 3 17715788 2012 4 18768890 2013 1 16370003 2013 2 17507882 2013 3 19003470 2013 4 20104348 2014 1 17311394 2014 2 19044190 2014 3 20544004 2014 4 22130452 2015 1 18467912 2015 2 19751014 2015 3 21788590 2015 4 23079842 2016 1 18885122 2016 2 20452234 2016 3 22235116 2016 4 24043612 2017 1 20586120 2017 2 21917574 2017 3 23718216 2017 4 25621246 2018 1 22845268 2018 2 25225572 2018 3 27508924 2018 4 29049874 2019 1 24944792 2019 2 26410242 2019 3 28875418 2019 4 29815600 end
0 Response to Interpolation Quarterly to Monthly ; Missing dates when generating them
Post a Comment