I would like to generate a variable that links a summarized market share of 4 biggest companies (TOP4) in a particular industry to every company in this industry.
I need this variable as a measure of competitiveness of an industry in which a particular company operates.
I have a database of companies and every company is in one industry. Industries are represented by integers from 1 to 99.
In one observation I have: CompanyID, Industry, MarketShare.
Here is an example:
How can I generate a TOP4 variable using Stata? I think that I have to use
and then somehow sort the shares and sum the biggest four.
Thank you for your help.
I need this variable as a measure of competitiveness of an industry in which a particular company operates.
I have a database of companies and every company is in one industry. Industries are represented by integers from 1 to 99.
In one observation I have: CompanyID, Industry, MarketShare.
Here is an example:
CompanyID | Industry | MarketShare | TOP4 |
1 | 1 | 40% | 40%+25%+15%+10% = 90% |
2 | 1 | 25% | 90% |
3 | 1 | 15% | 90% |
4 | 1 | 10% | 90% |
5 | 1 | 5% | 90% |
6 | 1 | 5% | 90% |
7 | 2 | 30% | 30%+30%+20%+15%=95% |
8 | 2 | 30% | 95% |
9 | 2 | 20% | 95% |
10 | 2 | 15% | 95% |
11 | 2 | 5% | 95% |
Code:
bys Industry:
Thank you for your help.
Comment