Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Herfindahl-Hirschman Index for banks

    Hello,

    I have a problem creating Herfindahl-Hirschman Index for my data I tried scc install hhi but it doesn't give a clear result

    this is how my table looks like

    Loan Firms Percentage
    1 A 55
    1 B 33
    1 C 17
    2 B 100


    I want The Herfindahl to be calculated using each syndicate member’s share in the loan; and varies from zero to 10,000, with 10,000 being the Herfindahl when a lender holds 100% of the loan

    I want the results to look like this

    Loan Firms Percentage hhi
    1 A 55 2500
    1 B 33 1089
    1 C 17 289
    2 B 100 10000


    any Ideas on what command should I use to make it look like this?

  • #2
    This might help:

    Code:
    clear 
    input loan str1 firms percentage
    1 A 50 
    1 B 33
    1 C 17
    2 B 100
    end 
    
    egen hhi = total(percentage^2), by(loan)
    
    list, sepby(loan)
    
         +---------------------------------+
         | loan   firms   percen~e     hhi |
         |---------------------------------|
      1. |    1       A         50    3878 |
      2. |    1       B         33    3878 |
      3. |    1       C         17    3878 |
         |---------------------------------|
      4. |    2       B        100   10000 |
         +---------------------------------+
    Notes:

    0. Please use dataex to give data examples as requested at https://www.statalist.org/forums/help#stata

    1. The example 55 + 33 + 17 is presumably in error.

    2. The index presumably applies to each loan.

    3. The bizarre convention of multiplying by 10000 is what it is, but this index is strictly a probability.

    4. With your data you surely don't need to install any extra command as you already have percent calculated.

    5. We can't comment on what happened with hhi from SSC (not SCC) because you don't give a clear example.

    Comment

    Working...
    X