I'd been 'battling' with something and I would like some help please.
For my panel data, I would like to identify the year each firm (identified by 'company_id') first enters the database, and enter this year under a new variable to be created, called 'EntryYr'.
Also to identify the last year of a firm's existence in the database and enter this year under a new variable to be created, called 'ExitYr', and then calculate its age for each year of existence (which would be 'year - EntryYr'). There will also be two new variables called 'Entry' and 'Exit' which will be '1' for each firm's entry year and exit year respectively, and '0' otherwise. The exit year will be the last year the firm existed in the database.
There will then be calculation of firm entry rates and exit rates per year, for each industry (NAICS) in each geographical location known as a CSD.
Entry rate in year t = ([number of new firms in CSD(i) and NAICS(j) in year t] / [number of existing firms in CSD(i) and NAICS(j) in year t-1]) x 100
Exit rate in year t = ([number of firms that exited CSD(i) and NAICS(j) in year t] / [number of firms that ever existed in CSD(i) and NAICS(j) in year t]) x 100
I know this would be quite involving and I would truly appreciate getting assistance.
Thank you!
Best,
Kele
year company_id CSD NAICS
2000 12362 31113 112
2001 12362 31113 112
2001 12363 31113 113
2002 12363 31113 113
2003 12363 31113 113
2000 12364 31114 114
2001 12364 31114 114
2002 12364 31114 114
2004 12367 31115 112
2005 12367 31115 112
2006 12367 31115 112
For my panel data, I would like to identify the year each firm (identified by 'company_id') first enters the database, and enter this year under a new variable to be created, called 'EntryYr'.
Also to identify the last year of a firm's existence in the database and enter this year under a new variable to be created, called 'ExitYr', and then calculate its age for each year of existence (which would be 'year - EntryYr'). There will also be two new variables called 'Entry' and 'Exit' which will be '1' for each firm's entry year and exit year respectively, and '0' otherwise. The exit year will be the last year the firm existed in the database.
There will then be calculation of firm entry rates and exit rates per year, for each industry (NAICS) in each geographical location known as a CSD.
Entry rate in year t = ([number of new firms in CSD(i) and NAICS(j) in year t] / [number of existing firms in CSD(i) and NAICS(j) in year t-1]) x 100
Exit rate in year t = ([number of firms that exited CSD(i) and NAICS(j) in year t] / [number of firms that ever existed in CSD(i) and NAICS(j) in year t]) x 100
I know this would be quite involving and I would truly appreciate getting assistance.
Thank you!
Best,
Kele
year company_id CSD NAICS
2000 12362 31113 112
2001 12362 31113 112
2001 12363 31113 113
2002 12363 31113 113
2003 12363 31113 113
2000 12364 31114 114
2001 12364 31114 114
2002 12364 31114 114
2004 12367 31115 112
2005 12367 31115 112
2006 12367 31115 112
Comment