Hi,
I am dealing with a dataset that has more than a million observations and lots of variables which I am currently cleaning. The period is 2000-2010. A snapshot of some selected variables are below:
I have to drop the kontor_handel values for which I do not have Fstat>20 for 3 consecutive years during 2000-2010. For example, if kontor_handel==101 have Fstat>20 for 2008 and 2009 but Fstat<20 for rest of the years, I will drop kontor_handel==101 from the dataset. I am a bit confuse how to do it in a loop. Any help would be appreciated. Here kontor_handel is an office identifier and there are more than 6000 unique kontor_handel.
Best,
Zariab
I am dealing with a dataset that has more than a million observations and lots of variables which I am currently cleaning. The period is 2000-2010. A snapshot of some selected variables are below:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input int B_sign1 float(kontor_handel year Fstat) 2212 101 2000 1.625441 19921 1715 2000 5.087852 23318 1832 2000 .9362963 16416 610 2000 196.11215 15961 102 2000 1.0428013 20233 1411 2000 128.31055 19162 119 2000 1.1356107 2091 1202 2000 86.18385 20900 1705 2000 75.96806 22704 910 2000 1.8002303 20221 1705 2000 75.96806 7327 2530 2000 201.6177 9458 1925 2000 85.46902 1224 1275 2000 30.58243 3984 2120 2000 132.3299 18390 1274 2000 2.7553794 493 1715 2000 5.087852 548 530 2000 124.24845 14381 1419 2000 31.884056 11070 2434 2000 1.0798155 end
Best,
Zariab
Comment