I am a thesis student from Belgium working on my thesis about labour market concentration. For my research, I need to calculate the HHI for multiple observations. Below, you find an example of the data which I have to use. The NACE Code represents the sector. I need to calculate the HHI for each NACE code and for each year. So for code 1 I need to have a result for all the years in a range from 1985 until 2014, and so on. Every row in the table represents one firm. So in my dataset there are multiple rows of data for the same NACE Code and year.
NACE Code | YEAR | EMPLOYEES |
1 | 1985 | 14 |
1 | 2010 | 5 |
2 | 1999 | 88 |
14 | 2000 | 79 |
15 | 1987 | 3 |
27 | 1992 | 45 |
45 | 2014 | 777 |
66 | 1998 | 23 |
97 | 2000 | 14 |
One thing I was thinking as a solution was working with some kind of loop command so that I can loop the same command for the whole dataset. However, I don't really know how to do this. I've tried some things so far but none of them have given me the desired result. I was wondering if anyone can help me out with this problem?
Thank you in advance!
Kind Regards
Robin Naessens
0 Response to Measuring HHI for datasets with lots of observations
Post a Comment