Skip to content

Sampling Effort API

standardised_richness

sars.standardised_richness

standardised_richness(abundance: DataFrame | ArrayLike, area: ArrayLike | None = None, base: str = 'coverage', level: float | None = None) -> pd.DataFrame

Species richness standardised for sampling effort, ready to fit.

The species found at a site depend on how hard it was sampled as well as on how many there are: a larger island often gets more transects, and then its richness is inflated by effort as well as area (Gooriah et al. 2021). This puts every site on an equal footing before a species-area curve is fitted, by rarefying (or extrapolating) each site's sample to the same sample coverage or the same number of individuals, as R's iNEXT does (Chao & Jost 2012; Chao et al. 2014).

Parameters:

Name Type Description Default
abundance pd.DataFrame or 2-D array-like

Species-by-site abundance table: one row per species, one column per site, counts of individuals (as coleman and iNEXT take). A table with sites in rows needs transposing first (df.T).

required
area array - like

Each site's area, in the order of the columns. If given, the result has an area column and can go straight to the fitting functions.

None
base str

"coverage" (the default): standardise to the same sample coverage, the share of the community's individuals that belong to species in the sample; sites are then compared at equal completeness. "size": standardise to the same number of individuals.

'coverage'
level float

The coverage (between 0 and 1) or number of individuals to standardise to. By default, as in iNEXT, the largest that every site reaches by extrapolating to twice its sample: the smallest coverage at twice each site's sample size, or the smallest doubled sample size.

None

Returns:

Type Description
DataFrame

One row per site: site, area (if given), species (the standardised richness), observed (the richness in the sample), individuals, coverage (the sample's own coverage), m (the sample size standardised to), coverage_at_m (the coverage at m: the level asked for, unless m was held at its minimum of one individual), method ("rarefaction", "extrapolation" or "observed") and level.

Raises:

Type Description
ValueError

If the table isn't a non-negative whole-number table with at least one individual at every site, base is unknown, level is out of range, or area doesn't have one value per site.

Warns:

Type Description
UserWarning

If a site is extrapolated beyond twice its sample, where the estimate is unreliable.

References

Chao A, Jost L (2012). Coverage-based rarefaction and extrapolation: standardizing samples by completeness rather than size. Ecology 93, 2533-2547. Chao A et al. (2014). Rarefaction and extrapolation with Hill numbers. Ecological Monographs 84, 45-67. Gooriah L et al. (2021). Synthesis reveals that island species-area relationships emerge from processes beyond passive sampling. Global Ecology and Biogeography 30, 2119-2131.

Examples:

>>> table = pd.DataFrame({"a": [10, 5, 1, 1], "b": [40, 20, 9, 3]})
>>> sars.standardised_richness(table, area=[1.0, 4.0])

load_xu_abundance

sars.load_xu_abundance

load_xu_abundance() -> pd.DataFrame

Load the butterfly counts behind load_xu, species by island.

The number of individuals of each of 68 butterfly species counted on each of the 42 islands of the Zhoushan Archipelago, China, by Xu et al. (2017): one row per species (the index, species), one column per island, in load_xu's order. Counts came from transects, and the number of individuals sampled grows with island area (from 2 to 1,102), so the observed richness reflects effort as well as area; standardised_richness takes this table. From the compilation of Gooriah et al. (2021), released under CC0.

Returns:

Type Description
DataFrame

Species-by-island counts.

References

Xu A, Han X, Zhang X, Millien V, Wang Y (2017). Nestedness of butterfly assemblages in the Zhoushan Archipelago, China: area effects, life-history traits and conservation implications. Biodiversity and Conservation 26, 1375-1392. Gooriah L, Blowes SA, Sagouis A, Schrader J, Karger DN, Kreft H, Chase JM (2021). Synthesis reveals that island species-area relationships emerge from processes beyond passive sampling. Global Ecology and Biogeography 30, 2119-2131.