EcoMetriQReference Book

7. Gamma diversity and alpha-beta-gamma partitioning (Gamma Diversity)

Tab: 🌍 Gamma Diversity · Code: ui/main_dialog.py:1244-1764 (interface), modules/alpha_beta_indices.py:974-1274 GammaDiversity (computation)

7.1 What this tab does

Gamma diversity is the diversity of the region (all sites together). Since Whittaker (1960), regional diversity has been split into two components: the mean diversity within the sites (alpha) and the difference between the sites (beta). This tab computes:

This tab uses abundance information: species counts (or record counts) enter the Shannon, Simpson and Hill q = 1, 2 values.

7.2 Screen and parameters

Figure 7.1. The whole Gamma Diversity tab, empty. Top: the Data Source group (site column name and import button); middle: the site-species-abundance table; bottom: computation options, summary cards and the result box.
Figure 7.1. The whole Gamma Diversity tab, empty. Top: the Data Source group (site column name and import button); middle: the site-species-abundance table; bottom: computation options, summary cards and the result box.
Name in the interface What it does Default Code
Data Source group Explains that the table can be filled by hand or imported from a CSV; the computation is always made from the table - ui/main_dialog.py:1257-1262
CSV site column name: Name of the site column on import site ui/main_dialog.py:1265-1270
📥 Import Sites from CSV Reads the file in Data Input and fills the table - ui/main_dialog.py:1407-1472
Site Definition (Manual) table Site Name, Species Name, Abundance empty ui/main_dialog.py:1279-1310
+ Add Row / - Remove Row / 🗑 Clear Table row operations; a new row copies the site name from the row above - ui/main_dialog.py:1373-1379
📄 Load Example Three-site, 15-row example table - ui/main_dialog.py:1381-1405
Baselga multi-site beta Adds the multi-site and pairwise Baselga section to the report on ui/main_dialog.py:1666-1684
Site contribution analysis Adds the site contribution table to the report on ui/main_dialog.py:1647-1664
Hill numbers (q=0,1,2) Adds the site-by-site Hill profile to the report on ui/main_dialog.py:1686-1707
🌍 Compute Gamma Diversity Computes - ui/main_dialog.py:1493-1524
Summary cards Gamma S, Mean Alpha S, Whittaker β, Gamma H' — ui/main_dialog.py:1332-1349
💾 Save TXT / 📊 Save CSV Saves the report or the summary tables - ui/main_dialog.py:1358-1367, 1584-1630

The computation is always made from the rows of the table; to take data from a CSV, press the Import Sites from CSV button. The three option boxes only add extra sections to the report; they do not change the computations.

7.2.1 Import rules

The importer re-reads the file loaded in Data Input (ui/main_dialog.py:1407-1472):

The table is filled sorted by site name, then by species name. With the sample data, 5 sub-watersheds and 1,045 rows (each row a site-species pair) are loaded.

Figure 7.2. The table after the sample data have been imported: each row is a site-species pair, Abundance is the number of records.
Figure 7.2. The table after the sample data have been imported: each row is a site-species pair, Abundance is the number of records.

7.3 Gamma-level measures

The GAMMA DIVERSITY (pooled sample) section of the report is computed by combining (pooling) the records of all sites as if they were a single community (modules/alpha_beta_indices.py:1035-1074):

  Gamma_Species_Richness                     694
  Gamma_Shannon                              6.1913
  Gamma_Simpson                              0.9975
  Gamma_Fisher_Alpha                         409.9909
  Gamma_Shannon_equal_weight                 6.1385
  Gamma_Hill_D0_Richness (q=0)               694
  Gamma_Hill_D1_Shannon_Equiv (q=1)          488.4645
  Gamma_Hill_D2_Simpson_Equiv (q=2)          329.8527
  Gamma_Chao1 (lower-bound estimate)         992.08
  Gamma_Chao1_CI_lower                       915.74
  Gamma_Chao1_CI_upper                       1094.71

The pooled gamma is identical to the alpha values computed for all records in Chapter 4. Gamma_Simpson is the unbiased form (§4.5.3). The formulas are the same as those in Chapter 4. The label of the line Gamma_Chao1 (lower-bound estimate) states that Chao1 is a lower-bound estimator of total richness, not a maximum (§4.8.2). Versions up to 1.1.1 labeled this line Gamma_Chao1 (estimated max), which was misleading. For record data, this value must not be reported as regional richness (§3.5).

7.3.1 Pooled and equal-weight gamma

In pooling, a site with many records enters gamma with more weight. For the partitioning to be consistent, alpha and gamma must be computed with the same weights (Lande 1996; Jost 2007). EcoMetriQ therefore defines a second gamma: the arithmetic mean of the relative abundance vectors of the sites, that is, equal weight (1/m) for each site:

\bar p_i = \frac{1}{m} \sum_{k=1}^{m} \frac{n_{ik}}{N_k}

Gamma_Shannon_equal_weight = -\sum_i \bar p_i \ln \bar p_i (6.1385 in the example). All partitionings use this equal-weight gamma (modules/alpha_beta_indices.py:1014-1074). The pooled gamma is used only for pool-level estimators such as Chao1 and ACE.

7.4 Mean alpha and Whittaker beta

  Mean_Alpha_Richness                        209.0
  Mean_Alpha_Shannon                         5.0903
  Mean_Alpha_Simpson                         0.9965
  Whittaker_Beta                             2.3206

\bar\alpha_S = \frac{1}{m}\sum_k S_k; \bar\alpha_{H'} is the mean of the H' values of the sites; Mean_Alpha_Simpson is the mean of the unbiased Simpson diversities of the sites (for display only; the partitioning uses the plug-in form). \beta_W = S_T / \bar\alpha_S - 1 (§6.4.1).

7.5 Additive partitioning

\gamma = \bar\alpha + \beta_{\text{add}} \qquad \beta_{\text{add}} = \gamma - \bar\alpha \qquad \text{share} = \beta_{\text{add}}/\gamma

Source: Lande (1996); Veech et al. (2002). Code: modules/alpha_beta_indices.py:1105-1145. For three measures:

Measure \gamma \bar\alpha \beta_{\text{add}} \beta/\gamma
Richness S 694 209.0 485.0 69.9%
Shannon H' (equal weight) 6.1385 5.0903 1.0482 17.1%
Gini-Simpson (plug-in, equal weight) 0.9970 0.9923 0.0047 0.5%

Because Shannon and Gini-Simpson are concave, \beta_{\text{add}} computed with equal weights is never negative.

Interpretation. 70% of richness arises from differences between sites: an average sub-watershed holds only 30% of the regional pool. For Shannon this share falls to 17%, and for Gini-Simpson to 0.5%. The reason is that as q increases, the weight of abundant species increases, and abundant species are shared more among sites: the sites differ mainly in their rare species. The size of additive beta depends on the unit of the measure (species, nats, probability); the \beta values of different measures are not directly comparable, only their shares are.

7.6 Multiplicative partitioning (with Hill numbers)

In the Jost (2007) framework, gamma, alpha and beta of order q are Hill numbers, and \gamma_q = \alpha_q \times \beta_q. With equally weighted sites, alpha is the generalized mean of order 1 - q of the Hill numbers of the sites:

\alpha_q = \left( \frac{1}{m} \sum_{k=1}^{m} \left({}^{q}D_k\right)^{1-q} \right)^{1/(1-q)} \qquad \alpha_1 = \exp\!\left( \frac{1}{m}\sum_k \ln {}^{1}D_k \right)

This is the arithmetic mean at q = 0, the geometric mean at q = 1 and the harmonic mean at q = 2. Gamma is the Hill number of the equal-weight vector \bar p_i, and beta is:

\beta_q = \frac{\gamma_q}{\alpha_q} \in [1,\, m] \qquad \beta_q^{\text{norm}} = \frac{\beta_q - 1}{m - 1} \in [0, 1]

Code: modules/alpha_beta_indices.py:1148-1199. In the sample data (m = 5):

q Type of mean \gamma_q \alpha_q \beta_q \beta_q^{\text{norm}}
0 arithmetic 694.0 209.0 3.321 0.580
1 geometric 463.4 162.4 2.853 0.463
2 harmonic 329.5 129.6 2.542 0.385

Interpretation. \beta_q is the "effective number of communities": the region is equivalent to \beta_q communities of equal diversity that share no species. \beta_0 = 3.32 means that the five sub-watersheds are as different in species composition as 3.3 independent communities. The order \beta_0 > \beta_1 > \beta_2 shows, as in the additive partitioning, that rare species are more site-specific than abundant species. The normalized value is a linear rescaling of \beta_q from [1,\, m] onto [0, 1]. It equals the multiple-site Sørensen-type dissimilarity 1-C_{0N} at q = 0 and 1-U_{2N} at q = 2, but corresponds to no standard overlap measure at q = 1. The sequence 0.580 / 0.463 / 0.385 in the table is therefore not on a common scale and cannot be compared across q. For comparing studies with different numbers of sites, the overlap measures of Chao, Chiu and Hsieh (2012) (1-C_{qN}, 1-U_{qN}) are preferable (sample data: Horn-type 1-C_{1N} = \ln\beta_1/\ln m = 0.65).

Why the harmonic mean at q = 2?

In the Jost (2007) definition, alpha is derived from the mean of the sites' "Hill number to the power 1-q"; at q = 2 this is the mean of 1/{}^2D_k, that is, the harmonic mean. Using the arithmetic mean inflates alpha and can even push beta below its theoretical lower limit (1). EcoMetriQ 1.0.0 contained this error; it was corrected in 1.1.0, and a test with two communities that share no species was added to the built-in validation (in this case \beta = 2 must hold for all q; Section 9.2).

7.7 Interpretation sections of the report

There are two interpretation sections. INTERPRETATION (modules/alpha_beta_indices.py:1257-1274) summarizes gamma, mean alpha, Whittaker beta and \beta_0 in a single paragraph. DETAILED INTERPRETATION (ui/main_dialog.py:1556-1647):

  Whittaker beta = 2.3206 → High: strong species turnover among sites.
  Species richness: 30% within-site (alpha) · 70% among-site (beta).
  Shannon H' partitioning: 17.1% of regional entropy is attributable to among-site differences.
  Hill beta D1=2.8526, D2=2.5418 → Meaningful among-site diversity detected.
  461 unique species found across all sites (most in 'aksu_cayi': 244 spp) — each site
  contributes irreplaceable species to the regional pool.
  Chao1 = 992 is a LOWER-BOUND estimate of regional richness: at least about 298 more
  species are expected to be undetected. The counts are numbers of records, not
  individuals, so this estimate should not be reported as regional richness.

The thresholds (Whittaker 0.2 / 0.5 / 1.0; Hill D_1 beta 1.05 / 1.2) are the program's reading rules and are not based on any source (§6.6). The sentence "Each site contributes irreplaceable species" is always written if there are site-specific species; in record data, the fact that a species occurs at only one site does not show that it is unique to that site, only that it was recorded there. The Chao1 sentence gives 992 as a lower-bound estimate of regional richness, states that at least about 298 more species are expected to be undetected, and notes that the counts are numbers of records, not individuals; this estimate must not be reported as regional richness (§3.5, §11.4). Version 1.1.1 wrote "Chao1 estimates 992 total species in the regional pool" at this point; that wording must not be reported in this form either.

7.8 Site contributions

  Site                 α S     α H     α J Unique Gamma Contrib
  aksu_cayi            416  5.7160  0.9478    244        0.5994
  bogacay_             125  4.7535  0.9845     41        0.1801
  koprucay_            152  4.9648  0.9882     43        0.2190
  krk_duden_cayi       171  4.9599  0.9646     59        0.2464
  manavgat_cayi        181  5.0573  0.9728     74        0.2608
Column Meaning Code
α S, α H, α J Richness, Shannon and Pielou evenness of the site modules/alpha_beta_indices.py:1201-1220
Unique Number of species found only at this site same
Gamma Contrib S_k / S_T: how much of the regional pool the site holds same

The names of the site-specific species are listed under each site. Gamma Contrib is not the share of site-specific species; it is the share of all the species of the site. Its sum therefore exceeds 1.

Interpretation. Of the 694 species, 461 (66%) were recorded in only one sub-watershed. Aksu, with 244 site-specific species, makes the largest contribution and is also the watershed sampled with the most records; the number of site-specific species must be read together with sampling effort (§5.5). After name cleaning (taxonomic curation), the number of site-specific species falls to 376 (§3.6).

7.9 Site-by-site Hill profile

  Site                 D0 (S)   D1 (exp H)   D2 (1/ΣP²)
  aksu_cayi               416     303.6796     217.4988
  bogacay_                125     115.9935     105.0182
  koprucay_               152     143.2828     132.6356
  krk_duden_cayi          171     142.5748     105.8859
  manavgat_cayi           181     157.1653     133.9776
  ★ GAMMA                 694     488.4645     329.8527

The ★ GAMMA row is the pooled gamma (§7.3); the equal-weight gamma used in the partitioning is 463.4 at q = 1. The difference between the two values arises because Aksu is represented more heavily in the pooled gamma.

Figure 7.3. The gamma tab after the computation: summary cards (Gamma S 694, Mean Alpha S 209, Whittaker β 2.3206, Gamma H' 6.1913) and the detailed report.
Figure 7.3. The gamma tab after the computation: summary cards (Gamma S 694, Mean Alpha S 209, Whittaker β 2.3206, Gamma H' 6.1913) and the detailed report.

Gamma H' in the summary cards is the pooled Shannon (6.1913), not the equal-weight value used in the partitioning (6.1385).

7.10 Common mistakes

7.11 Expert questions

Q1. Can I weight the sites by their size? No. EcoMetriQ gives each site equal weight in the partitioning. For weighted Jost partitioning, entropart::DivPart or vegan::multipart can be used.

Q2. Is it the same as vegan::multipart? vegan::multipart performs hierarchical multiplicative partitioning with a permutation test, and by default computes alpha with different weights. EcoMetriQ's values are reproduced exactly by applying the Jost (2007) equal-weight definition to the Hill numbers of the sites from vegan::renyi(..., hill = TRUE) (Validation, Part 4; Section 9.5).

Q3. Why is the Gini-Simpson beta so small? Gini-Simpson is bounded between 0 and 1 and is close to 1 in species-rich communities; the difference is inevitably small. This does not show that the sites are similar. In units of effective number of species, the same information is given by \beta_2 = 2.54.

Q4. Is there a significance test for additive partitioning? No. For a randomization test, use vegan::adipart.