EcoMetriQReference Book

4. Alpha diversity (Alpha Indices)

Tab: 📊 Alpha Indices · Code: ui/main_dialog.py:388-537 (interface), modules/alpha_beta_indices.py:97-784 AlphaIndices, 1228-1340 RaoQuadraticEntropy (computation)

4.1 What this tab does

Alpha diversity is the diversity within a single community: how many species there are, how evenly individuals are distributed among species, whether one species dominates, how complete the sampling is and how many unseen species there may be. This tab treats all species in the selected source as a single community:

The output is a single text report: basic measures, alpha indices, Hill numbers, sampling completeness, richness estimators, an interpretation line, Rao's quadratic entropy, dominant species and a numerical rarefaction table.

4.2 Screen and parameters

Figure 4.1. The Alpha Indices tab after computation with the sample data. The CSV source is selected; the abundance warning based on record counts is visible at the top of the result box.
Figure 4.1. The Alpha Indices tab after computation with the sample data. The CSV source is selected; the abundance warning based on record counts is visible at the top of the result box.
Name in the interface What it does Default Range Code
Source: Community to be computed Manual Table (Data Input tab) manual table / CSV (loaded from Data Input) ui/main_dialog.py:395-400
Step Count: Number of steps in the report's rarefaction table 20 5 - 100 ui/main_dialog.py:402-406
🔢 Compute Alpha Indices Computes and writes the report - - ui/main_dialog.py:470-537
💾 Export Results Saves the report as TXT - - ui/main_dialog.py:418-422

Step Count only determines how many rows the rarefaction table at the end of the report will have: the step size is taken as \lfloor N / \text{step} \rfloor and the expected number of species is written for n = 1, 1+\text{step}, \dots, N (modules/alpha_beta_indices.py:633-665). It does not affect any of the indices.

Select the source first

The default source is the manual table. If you compute after loading a CSV without setting the Source box to CSV (loaded from Data Input), you get the result for the eight bird species in the table (§3.8).

4.3 Structure of the report

The first part of the report with the sample data (Source: CSV):

  Abundance source : record_count
  No count/abundance column was found: each record was treated as one individual. ...

  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  SAMPLING ASSUMPTION: abundances were derived from the number of
  records per species, not from an abundance/count column. Chao1, ACE,
  Good's coverage and rarefaction assume a random sample of INDIVIDUALS
  from a closed assemblage. ...
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  Species Richness (S)                     694
  Total Individuals (N)                    1818
  Shannon-Wiener (H')                      6.1913
  Shannon Maximum (Hmax)                   6.5425
  Simpson Diversity (1-D, unbiased)        0.9975
  Gini-Simpson (plug-in, 1-sum p^2)        0.997
  Inverse Simpson (plug-in)                329.8527
  Simpson Dominance (D, unbiased)          0.0025
  Margalef Richness (d)                    92.3324
  Menhinick Richness                       16.2766
  Pielou Evenness (J')                     0.9463
  Berger-Parker (d)                        0.0121
  Fisher Alpha                             409.9909

The box with exclamation marks always appears for a file without a count column (§3.5). Below, each line of the report is explained with its formula, code location and sample value. The sample values refer to the sample data with S = 694 and N = 1{,}818 records.

4.4 Richness measures

Species richness is the number of different species present in an area or a sample. It is the oldest, most intuitive and most widely used measure of biological diversity (Magurran 2004). Its importance comes from three sources. First, it is the basis of conservation decisions: the selection of protected areas and hotspots, Red List assessments and inventory reports all begin with the question "how many species are there?". Second, it is the most direct indicator for monitoring: the loss of species from an area or the arrival of new ones is first seen as a change in richness. Third, it is the foundation of all other diversity measures: evenness, Hill numbers, and beta and gamma diversity are built on the species list.

Richness counts every species equally: a rare endemic with a single record carries the same weight as a common species with hundreds of records. Because it makes rare species visible, this is an advantage for conservation; but it says nothing about how abundant the species are or about the structure of the assemblage (for that see §4.5 and §4.6). Its main limitation is its dependence on sampling effort: the more records are collected, the more species are found, so observed richness is always a lower bound of true richness (Gotelli and Colwell 2001). The measures in this section answer the same question in different ways: S gives the observed number of species; Margalef and Menhinick try to scale S by the number of records; Fisher's alpha summarizes, with a single parameter, how the number of species grows with the number of records. Estimation of unseen species (Chao1, ACE) is in §4.8, and comparison at equal sample size is in Chapter 5.

4.4.1 Species richness S and total N

What it means. S is the direct answer to the question "how many species were recorded?"; it is the length of the area's species list. N shows how many records (or individuals) the list rests on and is needed to judge how reliable S is: 80 species from 100 records and 80 species from 2,000 records are very different sampling situations. In the sample data there are 694 species in 1,818 records; that the records are spread so thinly over the species indicates that the list is not yet complete (§4.7).

S is the number of species with at least one individual (record); N is the sum of all individuals (records). Manual table rows with a zero or negative count are discarded at the outset (modules/alpha_beta_indices.py:116-120).

Interpretation. S is the most direct measure but depends strongly on sample size: more records mean more species. The S values of samples of different sizes are not compared directly; rarefaction (Chapter 5) or sample coverage is used.

4.4.2 Margalef and Menhinick

What it means. As a sample grows, new species become harder to find, but S keeps increasing. These two indices answer the question "how many species are there for this many records?": by dividing the number of species by the logarithm (Margalef) or the square root (Menhinick) of the number of records, they try to bring samples collected with different effort roughly onto the same scale. A larger value means that more species were recorded for the same effort.

d_{Mg} = \frac{S - 1}{\ln N} \qquad d_{Mn} = \frac{S}{\sqrt{N}}

Source: Margalef (1958), Menhinick (1964). Code: modules/alpha_beta_indices.py:193-203. Example: d_{Mg} = 693/\ln 1818 = 92.33; d_{Mn} = 694/\sqrt{1818} = 16.28.

Interpretation. Both are old ratios that try to correct S for sample size; the correction is valid only if the species-individual relationship has a particular form. They can be used to rank samples collected with the same method; their absolute values are not interpreted.

4.4.3 Fisher's alpha

What it means. In nature most species are rare and only a few are abundant. Fisher et al. (1943) described this pattern with the log-series distribution; \alpha is the richness parameter of that distribution. A larger \alpha means more species among the same number of individuals, i.e. a richer assemblage. Unlike S, if the log-series assumption holds, \alpha does not keep increasing as the sample grows; this is why it has been recommended for comparing samples of different size (Magurran 2004).

The parameter \alpha of the log-series model is the solution of the following equation:

S = \alpha \ln\!\left(1 + \frac{N}{\alpha}\right)

Source: Fisher et al. (1943). The program solves the equation by Newton-Raphson: starting value \alpha_0 = S/\ln(1+N), at most 200 steps, stopping when the difference between steps falls below 10^{-10}; if a negative step occurs, \alpha is halved (modules/alpha_beta_indices.py:215-250). If every species is represented by a single individual (S = N), the equation has no finite solution; the program then writes "undefined (S = N: every species is a singleton)". Example: \alpha = 409.99.

Interpretation. If individuals are assumed to be distributed among species according to a log-series distribution, \alpha is relatively independent of sample size. In data with many singletons (here f_1 = 303), \alpha becomes very large. The log-series assumption has not been tested for record data; keep the value descriptive.

4.5 Shannon, evenness and Simpson

4.5.1 Shannon entropy H' and H_{\max}

H' = -\sum_{i=1}^{S} p_i \ln p_i \qquad H_{\max} = \ln S

Source: Shannon (1948). The natural logarithm is used (modules/alpha_beta_indices.py:125-131). Example: H' = 6.1913, H_{\max} = \ln 694 = 6.5425.

Interpretation. H' is the uncertainty in predicting the species of a randomly chosen individual; it reflects both richness and evenness. Its unit is the "nat" and it is not linear: doubling H' does not mean doubling diversity. For comparison, the Hill number D_1 = e^{H'} should be used (§4.6). The program's interpretation line flags H' as "outside the usual range" if it is below 1.5 or above 3.5 (the empirical range in Magurran 2004; modules/alpha_beta_indices.py:755-777). This is not a classification; in regional lists containing hundreds of species, such as the sample data, H' naturally exceeds 3.5.

4.5.2 Pielou's evenness J'

J' = \frac{H'}{\ln S}

Source: Pielou (1966). Code: modules/alpha_beta_indices.py:150-152. Example: J' = 6.1913 / 6.5425 = 0.9463. If S \le 1, 0 is returned.

Interpretation. It lies between 0 and 1; 1 is the case in which all species are equally abundant. J' also depends on S and comes out artificially high in data with many singletons: if every species has one or two records, evenness looks "perfect". The value J' = 0.946 for the sample data does not show that the plant community is truly even; it shows that the records are scattered across species. In the interpretation line, J' > 0.7 is labeled "high" and J' < 0.4 "low".

4.5.3 Simpson index: two forms

The program gives Simpson with two separate definitions, each labeled (modules/alpha_beta_indices.py:133-191):

\lambda = \sum_i p_i^2 \qquad \text{Gini-Simpson (plug-in)} = 1 - \sum_i p_i^2
D_{\text{unbiased}} = \frac{\sum_i n_i (n_i - 1)}{N (N - 1)} \qquad \text{Simpson diversity (unbiased)} = 1 - D_{\text{unbiased}}
Report line Definition Example R equivalent
Simpson Diversity (1-D, unbiased) 1 - D_{\text{unbiased}} 0.9975 none (by hand)
Gini-Simpson (plug-in, 1-sum p^2) 1 - \lambda 0.9970 vegan::diversity(x, "simpson")
Inverse Simpson (plug-in) 1/\lambda 329.85 vegan::diversity(x, "invsimpson")
Simpson Dominance (D, unbiased) D_{\text{unbiased}} 0.0025 none (by hand)

Source: Simpson (1949). D_{\text{unbiased}} is the probability that two individuals drawn at random without replacement from the same community belong to the same species; \lambda is its counterpart for drawing with replacement and is biased in small samples.

Interpretation. 1 - D is the probability that two randomly chosen individuals belong to different species. In species-rich communities it approaches 1 and loses its discriminating power (0.997 in the example). 1/\lambda (Hill D_2), read as an effective number of species, is much more informative: the sample data are as diverse as "330 equally abundant species". State in publications which form you used; when comparing with R, use the plug-in form.

4.5.4 Berger-Parker dominance

d_{BP} = \frac{\max_i n_i}{N}

Source: Berger and Parker (1970). Code: modules/alpha_beta_indices.py:209-213. Example: 22/1818 = 0.0121.

Interpretation. It is the share of the most abundant species. In the sample data the two species with the most records are tied (Cistus creticus and Salvia tomentosa, 22 records each); the index does not say which species is dominant, it only gives the largest share. The list of dominant species is in the DOMINANT SPECIES section of the report (§4.9).

4.6 Hill numbers

The Hill number of order q is "the number of equally abundant species that would give the same diversity" (effective number of species):

{}^{q}D = \left( \sum_{i=1}^{S} p_i^{\,q} \right)^{1/(1-q)} \qquad {}^{1}D = \exp(H')

Source: Hill (1973), Jost (2006). Code: modules/alpha_beta_indices.py:255-299.

Report line Order Formula Example Sensitive to
D0_Richness (q=0) 0 S 694 equal weight to rare species
D1_Shannon_Equiv (q=1) 1 e^{H'} 488.46 species in proportion to their abundance
D2_Simpson_Equiv (q=2) 2 1/\sum p_i^2 329.85 weight on abundant species

D_2 is the inverse of the plug-in Simpson concentration; that is, D_2 = 1/(1 - \text{Gini-Simpson}) holds exactly. It is not the inverse of the unbiased Simpson.

Interpretation. Hill numbers are in the same unit (number of species), so they can be compared and expressed as ratios directly. {}^0D \ge {}^1D \ge {}^2D always holds. The gap between them shows unevenness: if the three are close to each other, species are evenly distributed; if they drop quickly as q increases, a few species dominate. In the example {}^1D/{}^0D = 0.70: the effective number of species is about 70% of the observed species list. When comparing two communities, reporting all three orders gives much more information than a single index.

4.7 Sampling completeness: sample coverage

C = 1 - \frac{f_1}{N}
C_{\text{adj}} = 1 - \frac{f_1}{N} \cdot \frac{(N - 1) f_1}{(N - 1) f_1 + 2 f_2}

Source: Good (1953) classic coverage; Chao and Jost (2012) adjusted coverage. If f_2 = 0, the adjusted form is computed with f_1 - 1; if f_1 = 0, C_{\text{adj}} = C (modules/alpha_beta_indices.py:304-350). Example: f_1 = 303, f_2 = 154, C = 1 - 303/1818 = 0.8333, C_{\text{adj}} = 0.8334.

The Interpretation line in the report uses these bands:

C Text in the report
\ge 0.95 commonly regarded as near-complete sampling
0.90 - 0.95 commonly regarded as adequate
0.80 - 0.90 additional sampling advisable
< 0.80 undersampled; richness estimates unreliable

Interpretation. Sample coverage is the probability that the next individual drawn at random from the community belongs to a species already present in the sample. C = 0.83 means that the next record has a 17% probability of belonging to a species not yet recorded. The bands are common practice, not a statistical test; the program itself also recommends reporting the number itself. In record data, sample coverage is a rough indicator of how complete the inventory is.

4.8 Unseen species: Chao1 and ACE

4.8.1 Chao1, two forms

\hat S_{\text{Chao1}} = S + \frac{f_1^2}{2 f_2} \qquad (f_2 > 0)
\hat S_{\text{Chao1,bc}} = S + \frac{f_1 (f_1 - 1)}{2 (f_2 + 1)}

Source: Chao (1984) classic form; the bias-corrected form is from Chao (2005) and matches vegan::estimateR. When f_2 = 0, the form S + f_1(f_1-1)/2 of the bias-corrected estimator is used instead of the classic form (modules/alpha_beta_indices.py:355-374). Example: 694 + 303^2/(2 \cdot 154) = 992.08; bias-corrected 989.18.

4.8.2 Variance and 95% interval

Variance of the classic Chao1 (r = f_1/f_2):

\widehat{\mathrm{var}} = f_2 \left[ \tfrac{1}{2} r^2 + r^3 + \tfrac{1}{4} r^4 \right]

Variance of the bias-corrected form (k = f_2 + 1):

\widehat{\mathrm{var}}_{bc} = \frac{f_1(f_1-1)}{2k} + \frac{f_1(2f_1-1)^2}{4k^2} + \frac{f_1^2 f_2 (f_1-1)^2}{4k^4}

The interval is log-normal; with T = \hat S - S and z = 1.96:

K = \exp\!\left( z \sqrt{\ln\!\left(1 + \frac{\widehat{\mathrm{var}}}{T^2}\right)} \right) \qquad \left[\, S + \frac{T}{K} \;,\; S + T K \,\right]

Source: Chao (1987) for the variance of the classic form and the log-normal interval, Chao (2005) for the variance of the bias-corrected form; Colwell et al. (2012). Code: modules/alpha_beta_indices.py:376-462. Example: r = 1.9675, variance 2,048.0; interval 915.74 - 1,094.71 (bias-corrected: 913.59 - 1,090.79).

Lines in the report: Chao1, Chao1 CI_lower_95, Chao1 CI_upper_95, Chao1 Variance, Chao1_bias_corrected, Chao1_bc_CI_lower_95, Chao1_bc_CI_upper_95 and Chao1 Estimator_note, which explains the two forms. If f_1 = 0, Chao1 equals S and the interval collapses to a single point; if f_2 = 0, a note stating this is added.

Interpretation. Chao1 estimates the "minimum" number of unseen species that should be added to the observed species; it is a lower-bound estimator. The lower end of the interval never falls below S, because the log-normal interval is constructed relative to S. In the sample data, 992 species and the interval 916-1,095 show that the records will not remain limited to 694 species. Because these are record data, the number should not be written as "the true number of species in the basin". Remember that Chao1 drops to 837 after name cleaning (§3.6): every spelling error that inflates the number of singletons pushes Chao1 upward.

4.8.3 ACE

Rare species (n_i \le 10) and abundant species (n_i > 10) are separated. S_{\text{rare}}, N_{\text{rare}} and f_1 are computed over the rare species:

C_{\text{ace}} = 1 - \frac{f_1}{N_{\text{rare}}} \qquad \gamma^2 = \max\!\left(0,\; \frac{S_{\text{rare}}}{C_{\text{ace}}} \cdot \frac{\sum_{n_i \le 10} n_i (n_i - 1)}{N_{\text{rare}} (N_{\text{rare}} - 1)} - 1 \right)
\hat S_{\text{ACE}} = S_{\text{abund}} + \frac{S_{\text{rare}}}{C_{\text{ace}}} + \frac{f_1}{C_{\text{ace}}} \gamma^2

Source: Chao and Lee (1992); the threshold of 10 is as in the original definition and in EstimateS. Code: modules/alpha_beta_indices.py:464-487. Example: 1,019.48. The program does not give a confidence interval for ACE.

Interpretation. ACE uses the abundance information of more species than Chao1 (not only singletons and doubletons but all rare species up to 10). The closeness of the two estimators (992 and 1,019) is expected, because both depend mainly on the number of singletons; it is not evidence of reliability. With a high singleton share (44%), both may underestimate true richness.

4.9 Interpretation line, Rao's Q and dominant species

4.9.1 Interpretation line

INTERPRETATION : H'=6.191, J'=0.946 | above the usual empirical range for H'
(heuristic: Magurran 2004) | evenness high: abundances relatively balanced |
sample coverage C=0.83 (<0.90): richness estimates uncertain

This line is a reading aid based on only three thresholds (modules/alpha_beta_indices.py:755-777); it is not a result sentence for use in a publication.

4.9.2 Rao's quadratic entropy

Q = \sum_{i \ne j} d_{ij}\, p_i\, p_j

d_{ij} is the dissimilarity between species i and j (0-1). Source: Rao (1982). The equivalent number is given as 1/(1-Q) (Ricotta and Szeidl 2009). Code: modules/alpha_beta_indices.py:1277-1398.

A dissimilarity matrix cannot be supplied in the window; d_{ij} = 1 is taken for every pair of different species. In this case Q is exactly the Gini-Simpson index (Q = 0.997, equivalent number = D_2 = 329.85, Q_over_GiniSimpson = 1.0), and the report states explicitly that this is not functional diversity. For true functional/phylogenetic Q with a trait or phylogenetic dissimilarity matrix, use the Trait/phylogenetic dissimilarity matrix parameter in the Processing algorithm (Chapter 10.3). The matrix CSV must be square, symmetric, with a zero diagonal and values in the range [0, 1]; otherwise an error is raised. Species not present in the matrix are assigned d_{ij} = 1 and their names are listed in a warning.

4.9.3 Dominant species

  DOMINANT SPECIES:
    Cistus creticus                        22    1.2%
    Salvia tomentosa                       22    1.2%
    Arbutus andrachne                      21    1.2%
    Phillyrea latifolia                    19    1.1%
    Myrtus communis                        18    1.0%

The eight most abundant species, with their counts and shares; the bar length in characters is one third of the share (ui/main_dialog.py:519-523). The order of species with equal counts depends on the order of first appearance in the file.

4.10 Rarefaction table

At the end of the report there is a rarefaction table based on the Hurlbert (1971) expectation (formula in §5.4):

  RAREFACTION CURVE  (Hurlbert 1971 expectation; Heck et al. 1975 variance)
         n      E(S)        SD              95% CI
         1     1.000       n/a  not computed (S>400)
        91    82.214       n/a  not computed (S>400)
       181   150.190       n/a  not computed (S>400)
       ...

When S > 400, the variance and interval are not computed, because the Heck et al. (1975) variance requires O(S^2) operations over pairs of species (modules/alpha_beta_indices.py:633-665). With 400 or fewer species, the standard deviation and the 95% interval are written on every line. For site-by-site rarefaction and plots, see Chapter 5.

4.11 Running with the manual table

When Source: Manual Table is selected and the computation is run with the default eight bird species: S = 8, N = 226, H' = 1.8548, J' = 0.892, D_1 = 6.39, D_2 = 5.52; since there are no singletons or doubletons, C = 1 and Chao1 = ACE = 8.

The counts entered in the manual table are taken as numbers of individuals; therefore the record count warning (§3.5) is written only when the source is a CSV and the file has no count column (ui/main_dialog.py:485-488, modules/alpha_beta_indices.py:693-707).

4.12 Common mistakes

4.13 Expert questions

Q1. Why is there no confidence interval for Shannon in the window? The window does not compute a bootstrap interval. If Compute Shannon Bootstrap CI (slow) is selected in the Alpha Diversity Indices algorithm in Processing, a percentile bootstrap interval with 500 replicates and a fixed seed (default 42) is given (modules/alpha_beta_indices.py:489-558). For the sample data the result is 5.93 - 6.02, and the observed H' = 6.19 lies outside this interval: the plug-in H' estimator is biased downward in samples with many rare species, and the bootstrap samples reproduce this bias. When the observed value falls outside the interval, the algorithm adds the warning "The observed H' lies outside the bootstrap interval … Do not report this interval as a confidence interval for H'." and the number of singletons to the output (modules/alpha_beta_indices.py:558-567). This interval shows only sampling variability, not the bias; do not report it when the warning appears.

Q2. vegan and iNEXT give different results for Chao1; which one does EcoMetriQ agree with? EcoMetriQ gives both forms: Chao1_bias_corrected is identical to the S.chao1 value of vegan::estimateR. iNEXT::ChaoRichness multiplies the term f_1^2/(2f_2) by (N-1)/N; it is therefore very slightly (0.02% in the example) smaller than the classic Chao1.

Q3. Can I compare Hill numbers at equal sample coverage? No; EcoMetriQ does not perform coverage-based rarefaction and extrapolation. Use iNEXT (Hsieh et al. 2016) for this. For comparison at equal size, EcoMetriQ offers individual-based rarefaction (Chapter 5).

Q4. Which alpha measures can be reported safely for record data? S and the species list. The others describe record frequency; if they are reported, it should be stated that they "were computed from record frequencies". If there is a sampling unit (e.g. a plot), incidence-based estimators (Chao2, ICE) with a species × plot presence/absence table are more appropriate; EcoMetriQ does not compute them.

Q5. Why is Fisher's alpha so high? \alpha grows rapidly as the proportion of singletons increases. In the sample data, 44% of the species are singletons (f_1 = 303). This reflects the incompleteness of the inventory more than the diversity of the community.

Q6. Does J' = 0.95 mean "the community is very even"? Not for record data. When every species has one or two records, J' necessarily approaches 1. Evenness is not interpreted without true abundance data (counts of individuals).