I am working with a dataset with fiscal years, CIK codes and employee ids. For the fiscal years >=2016 I have the employee ids. The other fiscal years have missing values for the employee ids. Does someone know how I can replace the missing values with the employee ids?
This is how my data looks like:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input double fyear str10 cik long employee_id float FEMALE 2013 "0000001750" . . 2014 "0000001750" . . 2015 "0000001750" . . 2016 "0000001750" . . 2018 "0000001750" 18500219 0 2013 "0000001800" . . 2014 "0000001800" . . 2015 "0000001800" . . 2013 "0000001961" . . 2014 "0000001961" . . 2015 "0000001961" . . 2013 "0000002034" . . 2014 "0000002034" . . 2015 "0000002034" . . 2016 "0000002034" . . 2013 "0000002098" . . 2014 "0000002098" . . 2015 "0000002098" . . 2017 "0000002098" 68800109 0 2013 "0000002178" . . 2014 "0000002178" . . 2015 "0000002178" . . 2013 "0000002186" . . 2014 "0000002186" . . 2015 "0000002186" . . 2017 "0000002186" 56900001 0 2018 "0000002186" 56900001 0 2013 "0000002488" . . 2014 "0000002488" . . 2015 "0000002488" . . 2017 "0000002488" 4200506 0 2013 "0000002809" . . 2014 "0000002809" . . 2015 "0000002809" . . 2013 "0000002969" . . 2014 "0000002969" . . 2015 "0000002969" . . 2016 "0000002969" . . 2013 "0000003116" . . 2014 "0000003116" . . 2015 "0000003116" . . 2017 "0000003116" 24311273 0 2018 "0000003116" 24311273 0 2013 "0000003197" . . 2014 "0000003197" . . 2015 "0000003197" . . 2017 "0000003197" 24311395 0 2018 "0000003197" 24311395 0 2013 "0000003453" . . 2014 "0000003453" . . end format %ty fyear
Sarah
0 Response to Replacing missing values in groups
Post a Comment