| ses | R Documentation |
Compute standardized effect sizes by comparing observed diversity metrics against a null distribution from randomized communities. Supports multiple null model algorithms and works with most spacc output classes.
ses(
x,
species,
coords = NULL,
metric = NULL,
null_model = c("frequency", "richness", "both", "curveball", "torus", "spatial_swap"),
n_perm = 999L,
parallel = TRUE,
n_cores = NULL,
progress = TRUE,
seed = NULL
)
x |
A spacc output object. Supported classes: |
species |
A site-by-species matrix (required). The species matrix used
to produce |
coords |
Optional data.frame with columns |
metric |
Character or |
null_model |
Character. Null model algorithm:
|
n_perm |
Integer. Number of permutations. Default 999. |
parallel |
Logical. Use parallel processing for the underlying analysis?
Default |
n_cores |
Integer. Number of cores. Default |
progress |
Logical. Show progress? Default |
seed |
Integer. Random seed for reproducibility. |
SES is computed as:
SES = \frac{observed - \bar{null}}{sd_{null}}
A two-tailed p-value is calculated as the proportion of null values at least as extreme as the observed value:
p = \frac{2 \cdot \min(r, n_{perm} + 1 - r)}{n_{perm} + 1}
where r is the rank of the observed value among null values.
Null model algorithms:
"frequency": Tests whether species composition matters given observed
species frequencies
"richness": Tests whether species identity matters given observed site
richness
"both": Maintains both marginal totals; tests non-random species
co-occurrence patterns
"curveball": Efficient alternative to "both" with proven uniform
sampling properties
An object of class spacc_ses containing:
observed |
Numeric vector of observed metric values |
null_mean |
Mean of null distribution |
null_sd |
Standard deviation of null distribution |
ses |
Standardized effect size: (observed - null_mean) / null_sd |
p_value |
Two-tailed p-value |
n_perm |
Number of permutations |
null_model |
Null model algorithm used |
metric |
Metric name |
input_class |
Class of input object |
Gotelli, N.J. (2000). Null model analysis of species co-occurrence patterns. Ecology, 81, 2606-2621.
Strona, G., Nappo, D., Boccacci, F., Fattorini, S. & San-Miguel-Ayanz, J. (2014). A fast and unbiased procedure to randomize ecological binary matrices with fixed row and column totals. Nature Communications, 5, 4114.
spaccHill(), spaccBeta(), spaccMetrics()
coords <- data.frame(x = runif(20), y = runif(20))
species <- matrix(rbinom(20 * 15, 1, 0.3), nrow = 20)
sac <- spacc(species, coords, n_seeds = 10)
result <- ses(sac, species, n_perm = 19)
print(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.