fillin doesn't allow by: (but never understood why). I just wish there was a more efficient way to do it rather than reshaping twice.
Here is a silly example, a panel dataset that you want to make balanced (futile though that may be):
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(AreaID Year Var1 Var2) 1 2000 20 30 1 2001 21 32 2 2000 50 55 end fillin AreaID Year list +---------------------------------------+ | AreaID Year Var1 Var2 _fillin | |---------------------------------------| 1. | 1 2000 20 30 0 | 2. | 1 2001 21 32 0 | 3. | 2 2000 50 55 0 | 4. | 2 2001 . . 1 | +---------------------------------------+
0 Response to fillin (a question on Twitter)
Post a Comment