You should read the help for genearate and egen, but before you can
implement the right commands, you will also want to nail down the
definition of the HHI:
egen double sasset=sum(asset), by(state year)
bysort state year: g double shsqrd= (asset/sasset)^2
egen double HHI=sum(shsqrd), by(state year)
The above will be valid if you have a balanced panel. Have you
thought about what to do for firms that enter or exit the panel, or
are missing data for intermediate years?
-----Original Message-----
From: Dawood Ashraf [mailto:[email protected]]
Sent: Monday, July 11, 2005 11:35 AM
To: [email protected]
Subject: st: Herfindahl index
I am trying to calculate degree of concentration in an industry by using the
Herfindahl index. I am using the panel data where I have 10 years of time, 50
states, in every state there are a few companies.
bysort state: generate HERF= (asset/ sum(asset))^2 if repdte==1997
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/