Currently, I have a dataset with directors of whom I have their starting date and their end date at their current role. Where .c means that they are still working at the company in their role.
What I want is to expand per DirectorID for every calendar year he or she is employed in their role with a new variable 'year'.
For example, for the first DirectorID it would look like:
DirectorID Year
1310783 2019
1310783 2020
1310783 2021
Of course, the other variables still added to each row.
Kind regards,
Hidde van Emmerik
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input double DirectorID long(DateStartRole DateEndRole) str100 RoleName str256 DirectorName 1310783 21701 .c "Chairman/President/CEO" "Mike Roman" 534445 19047 19121 "Chairman Elect/President/CEO" "Inge Thulin" 33350 15802 19309 "Independent Director" "Mike Eskew" 330328 19449 .c "Independent Director" "Muhtar Kent" 1310783 21366 21701 "CEO" "Mike Roman" 1292666 19946 21683 "Independent Director" "Sondra Barbour" 33719 19309 21312 "Independent Director" "Doctor Vance Coffman" 33154 20486 .c "Independent Director" "Pat Woertz" 534445 19121 21366 "Chairman/President/CEO" "Inge Thulin" end format %td DateStartRole format %td DateEndRole
For example, for the first DirectorID it would look like:
DirectorID Year
1310783 2019
1310783 2020
1310783 2021
Of course, the other variables still added to each row.
Kind regards,
Hidde van Emmerik
Comment