My question focuses on a dataset of employees in the US. I want to generate a variable that tells me the percentage of employees with one specific characteristic (binary). I am not able to generate this variable because I would like to generate the number per company per year.
Based on the clear company_year identifier, I was able to get the overall number of employees per firm per year:
bysort identifier: gen Numb_Total_Employees = _N
Unfortunately, I am now not able to generate the other number due to the fact, that I need to consider only the employees with characteristic == 1.
Would appreciate every hint which could help!!!
Based on the clear company_year identifier, I was able to get the overall number of employees per firm per year:
bysort identifier: gen Numb_Total_Employees = _N
Unfortunately, I am now not able to generate the other number due to the fact, that I need to consider only the employees with characteristic == 1.
Would appreciate every hint which could help!!!

Comment