Hello everyone,
I am using panel data from Compustat and I need to create a sample of high-growth firms (keep only the gvkey of HGFs). The first definition of an HGF which I need to try is at least a 20% increase in sales for 3 consecutive years and a minimum of 10 employees in the base year. The whole sample period is 7 years (2013-2019) and the 3-year high-growth period can be anywhere within that. After xtset gvkey fyear I was given the following code by a professor of mine (I can't ask him for clarifications as he is currently away):
Also, I am interested to know whether there is any other way of creating a sample with these conditions.
Any help would be appreciated!
I am using panel data from Compustat and I need to create a sample of high-growth firms (keep only the gvkey of HGFs). The first definition of an HGF which I need to try is at least a 20% increase in sales for 3 consecutive years and a minimum of 10 employees in the base year. The whole sample period is 7 years (2013-2019) and the 3-year high-growth period can be anywhere within that. After xtset gvkey fyear I was given the following code by a professor of mine (I can't ask him for clarifications as he is currently away):
- gen sale1 = L.sale
- gen growth_sales = (sale - sale1) / sale1
- gen suffgrowth = 1 if growth_sales >= 0.2
- bysort gvkey: gen baseyear_emp_temp = emp if fyear == (whatever the base year is)
- bysort gvkey: gen baseyear_emp = max(baseyear_emp_temp)
- gen hgf = 1 if suffgrowth == 1 & L.suffgrowth == 1 & L2.suffgrowth == 1 & baseyear_emp >= 10
- gen gvkey_hgf = gvkey if hgf == 1
- keep gvkey_hgf
- drop if gvkey_hgf != .
Also, I am interested to know whether there is any other way of creating a sample with these conditions.
Any help would be appreciated!

Comment