 Dataplot Vol 2 Vol 1

# SIMPSON DIVERSITY INDEX

Name:
SIMPSON DIVERSITY INDEX (LET)
Type:
Let Subcommand
Purpose:
Compute the Simpson diversity index.
Description:
Diversity indices are statistics used to summarize the diversity of a population in which each member belongs to a unique group. For example, in ecology the groups are typically species. In ecology, species richness refers to number of species and species eveness refers to homogeneity of the species. That is, the more equal the proportions for each of the groups, the more homogeneous, or even, they are. Different fields of application may use different terminology for these concepts.

Given a vector of frequencies (counts), fi the Simpson diversity index is computed as

$$D = \sum_{i=1}^{k}{\left( \frac{f_{i}}{n} \right) ^2}$$

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

$$D = \sum_{i=1}^{k}{p_{i}^2}$$

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.

Syntax 1:
LET <par> = SIMPSON DIVERSITY INDEX <y>
<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.

Syntax 2:
LET <par> = RAW SIMPSON DIVERSITY INDEX <y>
<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.

Examples:
LET SDI = SIMPSON DIVERSITY P
Note:
The Simpson diversity is used in a wide variety of fields. It may be referred to by a different name or have a slightly different formulation in various fields.
Note:
Dataplot statistics can be used in a number of commands. For details, enter

The SIMPSON DIVERSITY INDEX command is not typically used in the context of these other commands.

Default:
None
Synonyms:
None
Related Commands:
 SHANNON DIVERSITY INDEX = Compute the Shannon diversity index.
References: Edward H. Simpson (1949), "Measurement of diversity," Nature, 163:688. Applications:
Data Management
Implementation Date:
2011/12
Program:

let p = data 0.25 0.15 0.40 0.20
let nk = size p
.
let a = simpson diversity index p

The 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.
.
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 x

The 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 x

The 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



NIST is an agency of the U.S. Commerce Department.

Date created: 12/08/2011
Last updated: 10/07/2016