|
SIMPSON DIVERSITY INDEXName:
Given a vector of frequencies (counts), fi the Simpson diversity index is computed as
with k and n denoting the number of groups and the total count, respectively. This index has a value between 0 and 1. Lower values indicate more diversity while higher values indicate less diversity. In some cases, you may have proportions rather than counts. In this case, the formula for the Simpson diversity index is
You may also have raw data. That is, each row of the response variable identifies which group that row belongs to. In this case, Dataplot will generate the frequency table and use the formulas above to compute the index.
<SUBSET/EXCEPT/FOR qualification> where <y> is the response variable; <par> is a parameter where the Simpson diversity index is saved; and where the <SUBSET/EXCEPT/FOR qualification> is optional. This syntax is used when the response variable is either a set of proportions or a set of counts. Dataplot sums the values in the response variable. If the sum equals 1, then it assumes the response variable contains proportions. Otherwise, it assumes the response variable contains frequencies. In either case, if negative values are encountered an error is reported.
<SUBSET/EXCEPT/FOR qualification> where <y> is the response variable; <par> is a parameter where the Simpson diversity index is saved; and where the <SUBSET/EXCEPT/FOR qualification> is optional. This syntax is used when the response variable is a group-id variable. The group frequencies will be computed automatically.
The SIMPSON DIVERSITY INDEX command is not typically used in the context of these other commands.
let p = data 0.25 0.15 0.40 0.20 let nk = size p . let a = simpson diversity index pThe following output is generated. THE COMPUTED VALUE OF THE CONSTANT A = 0.2850000 . . Following example from page 23 of: . . Brani Vidakovic (2011), "Statistics for Bioengineering . Sciences: With MATLAB and WinBUGS Support", Springer. . read y x 115 1 108 1 25 1 6 1 28 1 25 1 6 1 1 1 220 2 134 2 183 2 39 2 12 2 6 2 6 2 12 2 83 3 104 3 16 3 8 3 14 3 18 3 2 3 1 3 99 4 94 4 21 4 8 4 18 4 18 4 5 4 2 4 end of data . set write decimals 4 tabulate simpson diversity index y xThe following output is generated. Cross Tabulate SIMPSON DIVERSITY INDEX (Response Variables: Y ) --------------------------------------------- X | SIMPSON DIVERSI --------------------------------------------- 1.0000 | 0.2738 2.0000 | 0.2715 3.0000 | 0.3065 4.0000 | 0.2822 . let yn = cross tabulate sum y x let pn = y/yn tabulate simpson diversity index pn xThe following output is generated. Cross Tabulate SIMPSON DIVERSITY INDEX (Response Variables: PN ) --------------------------------------------- X | SIMPSON DIVERSI --------------------------------------------- 1.0000 | 0.2738 2.0000 | 0.2715 3.0000 | 0.3065 4.0000 | 0.2822
|