Announcement

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

  • Shannon-Weiner index

    Does anyone know how to caculate th Shannon
    -Weiner index using stata?

  • #2
    Wiener, not Weiner, but yes. Many commands here, such as entropyetc (SSC).

    Comment


    • #3
      I'll try,Thank you,Nick

      Comment


      • #4
        Hi ,Nick! I have already tried,but it told me there was too many values.@Nick Cox

        Comment


        • #5
          That's not much to go on, but I can guess why. I vaguely recall rewriting entropyetc so that the problem i am imagining wouldn't bite, but if so, the program isn't on the machine I am using now. More (much) later today, I hope.

          Meanwhile, do give the exact command you used now please (FAQ Advice #12).

          Comment


          • #6
            Here is my data.


            copy starting from the next line ------ ----------------
            Code:
            * Example generated by -dataex-. To install: ssc install dataex
            clear
            input int breedingyear double yield
            1983              5680
            1982              5625
            1981              4500
            .            7301.5
            .           6327.75
            1971              3945
            .                 .
            .                 .
            .              4578
            1934            1087.5
            .                 .
            .            6701.8
            .                 .
            .           4379.25
            .                 .
            .                 .
            .              3300
            .              4125
            .            3937.5
            .                 .
            .                 .
            .                 .
            .                 .
            .                 .
            .              5250
            1979              5850
            .                 .
            1972              6930
            .                 .
            .            4741.5
            1975              4518
            1983           6612.08
            .                 .
            .              6150
            .                 .
            .                 .
            .                 .
            .                 .
            1983                 .
            .                 .
            .           1670.33
            .                 .
            .                 .
            .                 .
            .              6750
            .                 .
            .                 .
            .                 .
            .                 .
            .                 .
            .              4950
            .                 .
            .                 .
            1985                 .
            .                 .
            .                 .
            .           5541.75
            .                 .
            1980            4546.5
            1980           4329.75
            .           6005.25
            .  3989.85009765625
            .                 .
            .           4799.25
            .              4527
            1998            4393.5
            .                 .
            .                 .
            .                 .
            .                 .
            .            5620.5
            .            5209.5
            .            4165.5
            .            4450.5
            1988           8600.25
            .                 .
            1989                 .
            1989          4050.215
            .                 .
            .                 .
            . 3907.949951171875
            .                 .
            .            3847.5
            .              3660
            .                 .
            .                 .
            1985              6840
            .            5869.5
            2001              2725
            .                 .
            .           4940.25
            .                 .
            .                 .
            1990            8443.5
            .                 .
            .                 .
            .                 .
            .            4381.5
            .              3885
            1990           4599.75
            .                 .
            1991              7830
            1991           7403.25
            1995              6750
            1998              4770
            .                 .
            1993       8665.799805
            1997              6600
            .                 .
            .                 .
            .                 .
            .                 .
            .              3612
            .                 .
            .                 .
            1980           5031.75
            .                 .
            .                 .
            .                 .
            .              6081
            .          5938.875
            1992              7500
            .                 .
            .              3816
            .              8250
            .              5319
            .              4200
            .              2000
            .           7742.25
            .              7074
            1985              6060
            1995            9577.5
            1988                 .
            .       8021.100098
            1983              3000
            .                 .
            .              6000
            .              8035
            .            6706.5
            1993            7085.7
            .              6210
            .              6807
            1983              1500
            .              5556
            .                 .
            .              6375
            1999              5250
            .              5820
            1953             919.5
            1957              2625
            1970            2767.5
            1953              2250
            .           4319.25
            .                 .
            .                 .
            .                 .
            .                 .
            .                 .
            .                 .
            .                 .
            .                 .
            .                 .
            .                 .
            .                 .
            .                 .
            .                 .
            1956          2476.875
            .                 .
            1949              2250
            1962              1575
            1977              2805
            . 3034.449951171875
            . 2656.800048828125
            .              2446
            .  3339.85009765625
            .  3541.64990234375
            .  3692.85009765625
            .           4421.65
            1968              3750
            1967              4800
            .                 .
            .                 .
            .              3600
            .                 .
            .              4629
            .              5712
            2003          6490.125
            1995            6844.5
            1997              6057
            1981              4515
            1990            5401.5
            1986            6373.2
            1930              3000
            .            7975.5
            .       7148.950195
            .                 .
            .  4667.39990234375
            .           4947.75
            1972                 .
            1972              3000
            .              3100
            1972           3486.75
            1973            4975.5
            .              5505
            .            6928.5
            1973          4426.875
            .          8137.125
            .              4875
            .              3723
            .              5148
            1970           3618.75
            .          3609.375
            .  3269.77490234375
            1976              1557
            1979            4294.5
            .              3918
            .              4092
            .  4490.10009765625
            .            3547.5
            .              4011
            .              2952
            .       3010.550049
            .       4968.149902
            .              5187
            .           4982.25
            .  6897.14990234375
            .           5931.75
            .           5774.25
            1967            3067.5
            .              6591
            .            7000.5
            .              6288
            .           7625.25
            .              5892
            .              6819
            .   7080.4501953125
            .           5888.25
            2006          7907.625
            .              6000
            2009          5363.025
            2009 5249.512500000001
            2002       7321.100098
            .            7993.5
            .              5349
            .          6724.125
            .           6866.25
            1995            8401.5
            .           7008.75
            .          6848.625
            2001              7383
            2009           8030.25
            2009          7477.875
            .              7953
            2001              8046
            1955              4425
            .            4330.5
            .           4185.75
            2006   5670.4501953125
            .          5521.125
            .   5123.7001953125
            .          4669.875
            .   7627.5751953125
            1996                 .
            .            7420.5
            .              6861
            2002 5944.200000000001
            1985              5625
            .           6648.75
            1986              7125
            2005          6385.875
            .                 .
            .  5542.72509765625
            .           7484.25
            .              6507
            .          7531.125
            2008           7934.25
            2006         7667.3625
            2011          6964.125
            1991            7612.5
            1964              4500
            .              3987
            1992           5394.75
            1992           3626.25
            .           2936.25
            .  6742.72509765625
            1996           3633.75
            .            3853.5
            .              4758
            .            4096.5
            .          3910.875
            .          4143.375
            .              4683
            .            3631.5
            .       6620.169922
            . 3911.114990234375
            . 3976.050048828125
            1958              1725
            1979              5625
            .              4125
            1982            4999.5
            end
            copy up to and including the previous line - ----------------

            Comment


            • #7
              my command is "entropyetc yield,by(year)"

              Comment


              • #8
                Then the answer is easy in a different way. I see no way that entropy or anything else computed by entropyetc is a suitable measure of anything for these data. Standard deviation, interquartile range, etc. possibly might serve as a measure of variability of yields. Also, yields are often better considered on a transformed scale.

                The standard case for entropy is a set of discrete categories with observed probabilities. There are continuous analogues but they fall far from any measure addressed by entropyetc.

                Sorry for any misdirection but I also add that a data example in #1 would have allowed this answer to be given much more quickly.

                Comment


                • #9
                  What if I calculate the mean and standard deviation of these data and group these data by m-2sd,m-1.5ad,m-sd,m-0.5sd,m,m+0.5sd,m+sd,m+1.5sd and m+2sd.?Can I use this command afer doing that step?

                  Comment

                  Working...
                  X