Dea All, I have this data set,
HTML Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input float(id date) long recycle
1 552 4926
1 553 4478
1 554 4281
1 555 4183
1 556 4254
1 557 4277
1 558 4506
1 559 4746
1 560 4288
1 561 4420
1 562 4317
1 563 4615
1 564 4133
1 565 4681
1 566 4487
1 567 4279
1 568 4252
1 569 4364
1 570    .
1 571    .
1 572    .
1 573    .
1 574    .
1 575    .
1 576 4727
1 577 4839
1 578 4429
1 579 4593
1 580 4651
1 581 4702
1 582 4658
1 583 4228
1 584 4114
1 585 3804
1 586 3290
1 587 3882
1 588 4185
1 589 3905
1 590 3757
1 591 3726
1 592 3842
1 593 4374
1 594 4426
1 595 4425
1 596 4880
1 597 4533
1 598 4485
1 599 4930
2 552  567
2 553  915
2 554 1681
2 555  964
2 556 1194
2 557 1215
2 558 1189
2 559 1088
2 560  965
2 561 1113
2 562 1137
2 563 1102
2 564 1305
2 565 1277
2 566 1202
2 567 1124
2 568 1186
2 569 1912
2 570    .
2 571    .
2 572    .
2 573    .
2 574    .
2 575    .
2 576 2472
2 577 2172
2 578 1820
2 579 1827
2 580 1711
2 581 2126
2 582 2211
2 583 2702
2 584 2775
2 585 3066
2 586 2877
2 587 3085
2 588 2690
2 589 1757
2 590 2403
2 591 2795
2 592 2930
2 593 2945
2 594 2948
2 595 2998
2 596 2902
2 597 3033
2 598 2875
2 599 3246
end
format %tm date
For each `id' (18 of those in my raw data), I have missing values on `recycle' from `2007m7' to `2007m12'. Due to seasonality, I'd like to use the average values of `recycle' in `2006m7' (one year before) and `2008m7' (one year after) to replace `recycle' in `2007m7', and so on (for other periods with missing values). Any suggestions? Thanks.