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), *f _{i}* the Shannon diversity index is computed as

H=nlog(n)−∑ki=1filog(fi)n

with *k* and *n* denoting the number of groups and the total count, respectively. If *f _{i}* = 0, then the

*f*log(

_{i}*f*) term is set to 0.

_{i}The maximum value of the index is LOG(*k*). This value occurs when each group has the same frequency (i.e., maximum eveness).

The Shannon equitability index is simply the Shannon diversity index divided by the maximum diversity

EH=Hlog(k)

This normalizes the Shannon diversity index to a value between 0 and 1. Note that lower values indicate more diversity while higher values indicate less diversity. Specifically, an index value of 1 means that all groups have the same frequency. Some analysts use 1 – E(H) so that higher values indicate higher diversity. Some analysts also use 1/E(H).

In some cases, you may have proportions rather than counts. In this case, the formula for the Shannon diversity index is

H=−∑ki=1pilog(pi)

with *p _{i}* denoting the proportion in group

*k*. As above, the Shannon equitability index is computed as

EH=Hlog(k)

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 = SHANNON <DIVERSITY/EQUITABILITY> INDEX

- <SUBSET/EXCEPT/FOR qualification>

- where is the response variable;

- <DIVERSITY/EQUITABILITY> specifies whether the diversity or equitability index is computed;

- is a parameter where the Shannon 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 = RAW SHANNON <DIVERSITY/EQUITABILITY> INDEX

- <SUBSET/EXCEPT/FOR qualification>

- where is the response variable;

- <DIVERSITY/EQUITABILITY> specifies whether the diversity or equitability index is computed;

- is a parameter where the Shannon 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 = SHANNON DIVERSITY P

- LET SEI = SHANNON EQUITABILITY P

Note:The Shannon diversity/equitability 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.Dataplot statistics can be used in a number of commands.