anova_sites {douconca} | R Documentation |
Utility function: community-level permutation test in Double Constrained Correspondence Analysis (dc-CA)
Description
anova_sites
performs the community-level permutation test of dc-CA
when site weights vary.
The test uses residual predictor permutation (ter Braak 2022), which is
robust against differences in site total abundance in the response
in dc_CA
(ter Braak & te Beest, 2022).
The arguments of the function are similar to those of
anova.cca
, but more restricted. With equal site-totals
as in dc_CA
, anova(object$RDAonEnv)
is much faster.
Usage
anova_sites(object, permutations = 999, by = NULL)
Arguments
object |
an object from |
permutations |
a list of control values for the permutations as
returned by the function |
by |
character |
Details
The algorithm is analogous to that of anova.wrda
. The function
is used in anova.dcca
.
Value
A list with two elements with names table
and eigenvalues
.
The table
is as from anova.cca
and
eigenvalues
gives the dc-CA eigenvalues.
References
ter Braak, C.J.F. & te Beest, D.E. 2022. Testing environmental effects on taxonomic composition with canonical correspondence analysis: alternative permutation tests are not equal. Environmental and Ecological Statistics. 29 (4), 849-868. doi:10.1007/s10651-022-00545-4
ter Braak, C.J.F. (2022) Predictor versus response permutation for significance testing in weighted regression and redundancy analysis. Journal of statistical computation and simulation, 92, 2041-2059. doi:10.1080/00949655.2021.2019256
Examples
data("dune_trait_env")
# rownames are carried forward in results
rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites
mod <- dc_CA(formulaEnv = ~ A1 + Moist + Mag + Use + Manure,
formulaTraits = ~ SLA + Height + LDMC + Seedmass + Lifespan,
response = dune_trait_env$comm[, -1], # must delete "Sites"
dataEnv = dune_trait_env$envir,
dataTraits = dune_trait_env$traits,
verbose = TRUE)
anova(mod)
a_species <- anova_species(mod)
a_species
# anova_species can be used for manual forward selection of
# trait variables, as done for environmental variables in the demo
# dune_FS_dcCA.r, based on the first eigenvalue and its significance
# and adding the first axis of the constrained species scores from mod to
# the Condition of a new mod.
(eig1_and_pval <- c(eig = a_species$eig[1], pval = a_species$table$`Pr(>F)`[1]))
a_species$eig
anova_sites(mod)