Suppose that I have many variables (in the following example, only one variable x1 is present) for a lot of companies (id) across many years (year).
In the year 2007 (and before), the data on x1 (and many others) are in half-year frequency; while in the year 2008 (and after) the data on x1 (and many others) are in quarterly frequency.
I'd like to construct monthly data so that in the same half-year (2007 and before) or the same quarter, the monthly observations are the same as the end observations of the half-year or quarterly observations. Any suggestions?
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int id float tm long x1 1101 564 . 1101 565 . 1101 566 . 1101 567 . 1101 568 . 1101 569 11922113 1101 570 . 1101 571 . 1101 572 . 1101 573 . 1101 574 . 1101 575 9817626 1101 576 . 1101 577 . 1101 578 12423117 1101 579 . 1101 580 . 1101 581 11760556 1101 582 . 1101 583 . 1101 584 10615331 1101 585 . 1101 586 . 1101 587 13033535 1102 564 . 1102 565 . 1102 566 . 1102 567 . 1102 568 . 1102 569 6037845 1102 570 . 1102 571 . 1102 572 . 1102 573 . 1102 574 . 1102 575 6207117 1102 576 . 1102 577 . 1102 578 12815413 1102 579 . 1102 580 . 1102 581 20180703 1102 582 . 1102 583 . 1102 584 17554606 1102 585 . 1102 586 . 1102 587 16931368 end format %tm tm
I'd like to construct monthly data so that in the same half-year (2007 and before) or the same quarter, the monthly observations are the same as the end observations of the half-year or quarterly observations. Any suggestions?
Comment