anova.cca0 {douconca} | R Documentation |
Permutation Test for canonical correspondence analysis
Description
anova.cca0
performs residual predictor permutation for cca0,
which is robust against differences in the
weights (ter Braak & te Beest, 2022). The arguments of the function are
similar to those of anova.cca
, but more restricted.
Usage
## S3 method for class 'cca0'
anova(
object,
...,
permutations = 999,
by = c("omnibus", "axis"),
n_axes = "all"
)
Arguments
object |
an object from |
... |
unused. |
permutations |
a list of control values for the permutations as
returned by the function |
by |
character |
n_axes |
number of axes used in the test statistic (default: |
Details
The algorithm is based on published R-code for residual predictor permutation in canonical correspondence analysis (ter Braak & te Beest, 2022), but using QR-decomposition instead of ad-hoc least-squares functions.
Note that anova.cca0
is much slower than anova.cca
.
As anova.cca
is implemented in lower level language,
it is difficult to see what it implements.
In simulations (with and without Condition()
)
anova.cca
gives results that are very similar
to residual predictor permutation (RPP),
but, with by = "axis"
, it can be conservative
and is then less powerful than RPP (as tested with vegan 2.6-8).
Value
A list with two elements with names table
and eigenvalues
.
The table
is as from anova.cca
and
eigenvalues
gives the CCA 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
Examples
data("dune_trait_env")
# rownames are carried forward in results
rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites
abun <- dune_trait_env$comm[, -1] # must delete "Sites"
mod <- cca0(formula = abun ~ A1 + Moist + Mag + Use + Manure,
data = dune_trait_env$envir)
mod # Proportions equal to those Canoco 5.15
scores(mod, which_cor = c("A1", "X_lot"), display = "cor")
set.seed(123)
anova(mod)
anova(mod, by = "axis")
mod2 <- vegan::cca(abun ~ A1 + Moist + Mag + Use + Manure,
data = dune_trait_env$envir)
anova(mod2, by = "axis")
dat <- dune_trait_env$envir
dat$Mag <- "SF"
predict(mod, type = "lc", newdata = dat)