Question about Herfindahl index
Posted: 01 August 2012 09:30 AM   [ Ignore ]
Sr. Member
RankRankRankRank
Total Posts:  169
Joined  2011-09-20

Dear Joost,

I am learning about the Herfindahl index:
http://en.wikipedia.org/wiki/Herfindahl_index

it seems to me that the Herfindahl index is defined on the industry level.

I guess I didn’t get the intution why it is calculated on the firm level… Could you please explain the intution behind this calculation?

in other words, why in 2sls regressions, we need to have herfindahl index without this firm?

Thanks!

 Signature 

Zenghui
A humble student of business

Profile
 
 
Posted: 01 August 2012 10:58 AM   [ Ignore ]   [ # 1 ]
Sr. Member
RankRankRankRank
Total Posts:  169
Joined  2011-09-20

*SAS code to calculate Herfindahl index on the industry - year level;

*smaller funda file;
data age.temp_funda;
set comp.funda;
where 1985 <= fyear <=2060 and indfmt=‘INDL’ and datafmt=‘STD’ and popsrc=‘D’ and consol=‘C’;
run;

*keep only the variables needed for herfindahl calculation and firm key, fyear;
data funda_herfindahl (keep = gvkey cusip cik fyear naicsh sich sale);
set age.temp_funda;
if FIC = “USA” then output;
run;

* calculate market size by industry , fyear;
proc sql;
create table work.herfindahl1 as
  select gvkey, fyear, sich, sale, sum(sale) as market_size, count(sich) as firm_num
  from funda_herfindahl
  group by fyear, sich
  ;
quit;

*get the market share squares;
data work.herfindahl2;
set work.herfindahl1;
if sich = . then delete;
if market_size = 0 or market_size = . then delete;
market_share_sqr = (sale/market_size)*(sale/market_size);
run;

*calculate the herfindahl index;
proc sql;
create table age.herfindahl as
  select gvkey, fyear, sich, sale, firm_num, market_size, market_share_sqr, sum(market_share_sqr) as Herfindahl
  from work.herfindahl2
  group by fyear, sich
  ;
quit;

 Signature 

Zenghui
A humble student of business

Profile
 
 
Posted: 01 August 2012 10:59 AM   [ Ignore ]   [ # 2 ]
Sr. Member
RankRankRankRank
Total Posts:  169
Joined  2011-09-20

Joost,

Is there a mapping file from Naics to SICs on Wrds?

some of obs in funda have missing Sics with NAICs. it could be helpful if we find a mapping file.

Thanks,
Zenghui

 Signature 

Zenghui
A humble student of business

Profile
 
 
Posted: 01 August 2012 11:13 AM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  901
Joined  2011-09-19

hi Zenghui,

I have not come across such mapping - would be very useful!

Thanks for the code! (the big pain is in excluding firms one-by-one; takes forever with ‘call execute’)

The primary reason I want to exclude the firm itself is because I am using the measure to compare the competitive environment between focused firms and diversified firms. (A lower Herf means more competition)

Diversified firms—almost by definition—are larger, so the Herf index will be larger. By removing the firm effect I can test for differences in Herf, which is now based on other firms only.

For 2SLS/IV/etc it may not matter that much. As a general rule, an instrument is ‘good’ if the firm has no influence over it.

best regards,

Joost

 Signature 

To reply/post new questions: Please use the group WRDS/SAS on Google Groups! http://groups.google.com/d/forum/wrdssas

Profile