Announcement

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

  • #46
    Well I think it works now and I have the right results I think. I only have one final question. All the results are less than 1 so 0.xxxx. When I read about the HHI I find numbers which are higher than 1000. How is this possible and can I just multiply my results bij 1000, or does it not work that way?

    Comment


    • #47
      I think it was working before -- hhi was doing what the definitions imply. Otherwise, it comes down to your chosen units. A sum of squared probabilities can't exceed 1, if you wish to report that as a percent of possible it can't exceed 100 and if you wish to report it as a sum of squared percentages the upper limit is 10000. Where the factor 1000 comes from I can't say.

      Comment


      • #48
        I am sorry I ment multiply by 10000. I would like to report it as a sum of squared percentages so this means then multiply my results by 10000 right?

        Comment


        • #49
          That's correct if it's what you want.

          Comment


          • #50
            Hello mohina saxena . I wanted to ask you for your dataset have you extracted net sales as it is or have squared the original value of net sales before executing HHI

            Comment


            • #51
              Hello mohina saxena . I wanted to ask you for your dataset have you extracted net sales as it is or have squared the original value of net sales before executing HHI

              Comment


              • #52
                Dear All,

                I need to calculate the HHI to see if there is political fragmentation. More specifically I want to calculate this:

                Click image for larger version

Name:	Capture_HHI.JPG
Views:	1
Size:	14.9 KB
ID:	1732156

                However, in my dataset I have the data like this:

                ID panel_ID YEAR BoC SEAT
                [board composition (the number of parties) (seats of the board)

                1 1 2015 4 27
                2 1 2016 4 27
                3 2 2015 5 41
                4 2 2016 5 41
                5 3 2015 7 41
                6 3 2016 7 41
                7 3 2017 8 41

                I so confused.
                In order to measure the herfindahl index will I use the following code?
                HHI SEAT, by (BoC year)

                Thank you

                Comment


                • #53
                  year or YEAR (whichever it is) explains itself, The rest of your variables are not so clear to me.

                  Cleaning up your data example (thanks) as an example for dataex

                  -- please read and follow https://www.statalist.org/forums/help#stata in giving data examples --

                  does not help me, as given BoC YEAR all subsets are single observations so the Gini-Friedman-Turing-Simpson-Hirschman-Herfindahl-Good-Blau index (*)(+) is identically 1 for each subset, regardless of details.


                  Code:
                  clear 
                  input ID panel_ID YEAR BoC SEAT
                  1 1 2015 4 27
                  2 1 2016 4 27
                  3 2 2015 5 41
                  4 2 2016 5 41
                  5 3 2015 7 41
                  6 3 2016 7 41
                  7 3 2017 8 41
                  end 
                  
                  list, sepby(BoC YEAR)
                  
                       +-----------------------------------+
                       | ID   panel_ID   YEAR   BoC   SEAT |
                       |-----------------------------------|
                    1. |  1          1   2015     4     27 |
                       |-----------------------------------|
                    2. |  2          1   2016     4     27 |
                       |-----------------------------------|
                    3. |  3          2   2015     5     41 |
                       |-----------------------------------|
                    4. |  4          2   2016     5     41 |
                       |-----------------------------------|
                    5. |  5          3   2015     7     41 |
                       |-----------------------------------|
                    6. |  6          3   2016     7     41 |
                       |-----------------------------------|
                    7. |  7          3   2017     8     41 |
                       +-----------------------------------+
                  Let's back up and I will guess what you want using an example.

                  In given elections in given years parties A, B, C had seats as follows:

                  Code:
                  * Example generated by -dataex-. For more info, type help dataex
                  clear
                  input float year str2 party float seats
                  2019 "A"  20
                  2019 "B"  30
                  2019 "C"  50
                  2023 "A"  25
                  2023 "B"  35
                  2023 "C " 40
                  end
                  All community-contributed commands in this territory, mine too, are just convenience wrappers. Each concise definition points to concise code using only official commands.

                  The total number of seats should be calculated first and then the index follows.


                  Code:
                  * Example generated by -dataex-. For more info, type help dataex
                  clear
                  input float year str2 party float seats
                  2019 "A"  20
                  2019 "B"  30
                  2019 "C"  50
                  2023 "A"  25
                  2023 "B"  35
                  2023 "C " 40
                  end
                  
                  bysort year : egen total_seats = total(seats)
                  
                  by year : egen wanted = total((seats/total_seats)^2)
                  
                  list, sepby(year)
                  
                       +------------------------------------------+
                       | year   party   seats   total_~s   wanted |
                       |------------------------------------------|
                    1. | 2019       A      20        100      .38 |
                    2. | 2019       B      30        100      .38 |
                    3. | 2019       C      50        100      .38 |
                       |------------------------------------------|
                    4. | 2023       A      25        100     .345 |
                    5. | 2023       B      35        100     .345 |
                    6. | 2023      C       40        100     .345 |
                       +------------------------------------------+

                  I hope that helps. If it doesn't, I think you'll need to give a better data example and more explanation of what you want.


                  (*) The list of authors should not be assumed to be complete.
                  (+) Some people use 1 minus the quantity in #52, and Hirschman had a square root, but what the heck! It's the same idea in different flavours, so long as you're clear which way you like it.

                  Comment

                  Working...
                  X