Dataset looks like:
Finishes.
id | year1 | year2 | number | number_cit |
111 | 2000 | 1995 | 100001 | 0 |
111 | 2001 | 1995 | 100001 | 2 |
111 | 2002 | 1995 | 100001 | 5 |
111 | 2000 | 1998 | 100002 | 0 |
111 | 2001 | 1998 | 100002 | 1 |
111 | 2002 | 1998 | 100002 | 0 |
111 | 2000 | 1999 | 100003 | 10 |
111 | 2001 | 1999 | 100003 | 14 |
111 | 2002 | 1999 | 100003 | 22 |
Code:
*generate industry codes destring sic, replace gen sic_str = string(sic) gen sic2 = substr(sic_str, 1, 2) gen sic3 = substr(sic_str, 1, 3)