1. Top page
  2. Analyses on Ecological Assemblages
  3. Diversity Indices

Analyses on Ecological Assemblages

Diversity Indices

Many types of diversity indices are proposed to evaluate diversity of ecological assemblages: Shannon's H', Simpson's 1/D, and also Number of species S. Here, we learn how to produce the Renyi's diversity profile and to compare diversity indices of different sample size.

Renyi's Diversity Profile

Renyi's diversity profile summerize several diversity indices by an order of a sensitivity parameter "q". Please find an additional explanation in the Caluculating Biodiversity page.

First, load the vegan package require(vegan) and a data file. In the example below, we use a csv file with the first row containing site names. The argument row.names=1 set the site names as row names. Check the data by str(dat) and head(dat) before following calculations.

dat <- read.csv("spcdat.csv", header=TRUE, row.names=1)

Then, diversity indices are calculated by the function renyi(). The diversity values are coverted to their expornential by exp(), to express their unit as same as the species number.

x <- exp(renyi(dat))
print(x)
##          0      0.25       0.5         1         2         4        8
## Ako1    25 12.168433  5.644704  2.136354  1.403578  1.261169 1.220067
## Ako2     9  7.607329  6.429064  4.793829  3.449102  2.834064 2.558208
## Ako3    12 11.313568 10.624328  9.277639  7.031250  4.903061 3.958639
## Nisio1  20 17.721953 15.678444 12.513186  9.295082  7.409906 6.416410
## Nisio2  15 13.111197 11.510469  9.188904  6.914894  5.425780 4.590049
## Nisio3  22 18.787211 15.961218 11.651125  7.245509  4.737018 3.826000
## Nakatu1 24 15.925404 10.062048  4.679559  2.724889  2.215373 2.006270
## Nakatu2 17 13.318593  9.946950  5.274772  2.549025  1.907142 1.739198
## Nakatu3 16 15.304864 14.620043 13.326661 11.250000  9.030202 7.547984
## Banzu1  17  9.289197  5.584731  3.245602  2.369967  2.007683 1.838745
## Banzu2  18 10.371035  5.615125  2.248102  1.403852  1.257508 1.217014
## Banzu3  18 10.975092  6.841703  3.754489  2.715128  2.462483 2.377512
## Uto1    19 13.545967  9.244142  4.489319  2.290161  1.776990 1.637030
## Uto2    18 14.764482 11.843801  7.547466  4.145499  2.879066 2.483029
## Uto3    19 17.687146 16.522266 14.650596 12.367647 10.444599 9.077937
##               16       32       64      Inf
## Ako1    1.203995 1.196806 1.193398 1.190106
## Ako2    2.414975 2.347487 2.315905 2.285714
## Ako3    3.611913 3.465340 3.397648 3.333333
## Nisio1  5.842486 5.537953 5.390020 5.250000
## Nisio2  4.180089 3.992578 3.905799 3.823529
## Nisio3  3.498711 3.360180 3.296155 3.235294
## Nakatu1 1.915999 1.876229 1.857582 1.839695
## Nakatu2 1.676200 1.648502 1.635474 1.622951
## Nakatu3 6.748518 6.356848 6.173093 6.000000
## Banzu1  1.766001 1.733898 1.718817 1.704331
## Banzu2  1.201183 1.194101 1.190744 1.187500
## Banzu3  2.329294 2.290771 2.263654 2.235000
## Uto1    1.584113 1.560779 1.549789 1.539216
## Uto2    2.336969 2.273845 2.244389 2.216216
## Uto3    8.206828 7.724947 7.481571 7.250000

When the sensitivity parameter q=0, the value is the species number, q=1 is the exponential Shannon (expH’), q=2 is the inverse Simpson (1/D), and q=Inf is the inverse relative dominance (1/P1).

Rarefaction, Extrapolation, and Confidence Interval

Diversity indices are severly affected by sample size (total number of individuals). With increasing sample size, probability of sampling rare species increases. To compare diversity indices of several assemblages, their sample sizes should be the same.

  • Another opinion: sampling area should be the same instead of the sample size, because the density is one of the characteristics of assemblages.

First, load the iNEXT package require(iNEXT) and transpose the data file by t(). The calculation is time-consuming, so the example below uses only assemblage data of 5 sites.

dat2 <- t(dat[4:8,])

Then, rarefaction, extrapolation, and confidence intervals of diversity indices are calculated by iNEXT(). The argument q=c(0, 1, 2)indicate sensitivity parameters (0: number of species, 1: Shannon, 2: Simpson). Because this example use an abundance data, set an argument datatype="abundance".

out <- iNEXT(dat2, q=c(0,1,2), datatype="abundance")

When the input data is "presence/absense" (0/1), set the argument datatype="incidence_raw".

ggiNEXT() shows graphical plots. out shows a numerical output.

ggiNEXT(out, facet.var = "order")

The left panel shows the number of species (S, q=0), the center panel shows the exponential Shannon (expH', q=1), and the right panel shows the inverse Simpson (1/D, q=2). Solid lines indicate rarefaction, broken lines indicate extrapolation. Shaded areas are 95% confidence intervals.

It is hard to see any difference in the number of species between Nisio2 (blue) and Nakatu1 (red), because of a large overlap of their confidence intervals. On the other hand, expH’ and 1/D show little overlap of their confidence intervals, and it is safe to say that Nisio2 has the higher diversity than Nakatu1.


References

  • Borcard D, Gille F, Legendre P (2011) Numerical Ecology with R. Springer
  • Chao A, Gotelli NJ, Hsieh TC, Sander EL, Ma KH, Colwell RK, Ellison AM (2014) Rarefaction and extrapolation with Hill numbers: a framework for sampling and estimation in species diversity studies. Ecological Monographs 84: 45-67.
  • Magurran AE, McGill BJ (2011) Biological Diversity. Oxford Univ.

Back to"Analyses on Ecological Assemblages by R"