cca), Redundancy Analysis
(rda) or Constrained Analysis of Principal Coordinates
(capscale) to assess the significance of constraints.## S3 method for class 'cca':
anova(object, alpha=0.05, beta=0.01, step=100, perm.max=9999,
by = NULL, ...)permutest(x, ...)
## S3 method for class 'cca':
permutest(x, permutations = 99,
model = c("reduced", "direct", "full"),
first = FALSE, strata, ...)
cca.by = "axis" will assess significance for each
constrained axis, and setting by = "terms" will assess
significance for each term (sequentially from first to last), and
setting by = "margin" will asanova.cca passes all arguments to
permutest.cca. In anova with by = "axis" you
can use argument cutoff (defaults 1) which stopanova.cca.permutest.cca returns an object of class
"permutest.cca", which has its own print method. The
function anova.cca calls permutest.cca, fills an
anova table and uses print.anova for printing.anova.cca and permutest.cca implement an ANOVA
like permutation test for the joint effect of constraints in
cca, rda or capscale.
Functions anova.cca and permutest.cca differ in printout
style and in interface.
Function permutest.cca is the proper workhorse, but
anova.cca passes all parameters to permutest.cca. In anova.cca the number of permutations is controlled by
targeted alpha) and accepted Type
II or rejection error (beta). If the results of permutations
differ from the targeted alpha at risk level given by
beta, the permutations are
terminated. If the current estimate of $P$ does not
differ significantly from alpha of the alternative hypothesis,
the permutations are
continued with step new permutations (at the first step, the
number of permutations is step - 1). However, with by =
"terms" a fixed number of permutations will be used, and this
is given by argument permutations, or if this is missing,
by step.
The function permutest.cca implements a permutation test for
the cca,
rda or capscale. Community data are
permuted with choice model = "direct", residuals after
partial CCA/RDA/CAP with choice model = "reduced" (default),
and residuals after CCA/RDA/CAP under choice model = "full".
If there is no partial CCA/RDA/CAP stage, model = "reduced"
simply permutes the data and is equivalent to model = "direct".
The test statistic is ``pseudo-$F$'',
which is the ratio of constrained and unconstrained total Inertia
(Chi-squares, variances or something similar), each divided by their
respective ranks. If there are no conditions (X ~ Z). Consequently,
the total Chi-square is not fixed, and test based on pseudo-$F$
would differ from the test based on plain eigenvalues. CCA is a
weighted method, and environmental data are re-weighted at each
permutation step using permuted weights.
The default test is for the sum of all constrained eigenvalues.
Setting first = TRUE will perform a test for the first
constrained eigenvalue. Argument first can be set either in
anova.cca or in permutest.cca. It is also possible to
perform significance tests for each axis or for each term
(constraining variable) using argument by in
anova.cca. Setting by = "axis" will perform separate
significance tests for each constrained axis. All previous
constrained axes will be used as conditions (cutoff to speed up
calculations in large models. Setting by = "terms" will
perform separate significance test for each term (constraining
variable). The terms are assessed sequentially from first to last,
and the order of the terms will influence their
significances. Setting by = "margin" will perform separate
significance test for each marginal term in a model with all other
terms. The marginal test also accepts a scope argument for
the drop.scope which can be a character vector of term
labels that are analysed, or a fitted model of lower scope. The
marginal effects are also known as .Random.seed, and the seed
will be advanced to the value after the longest permutation at the
exit from the function.
Legendre, P., Oksanen, J. and ter Braak, C.J.F. (2011). Testing the significance of canonical axes in redundancy analysis. Methods in Ecology and Evolution 2, 269--277.
cca, rda, capscale
to get something to analyse. Function drop1.cca calls
anova.cca with by = "margin", and
add1.cca an analysis for single terms additions, which
can be used in automatic or semiautomatic model building (see
deviance.cca).data(varespec)
data(varechem)
vare.cca <- cca(varespec ~ Al + P + K, varechem)
## overall test
anova(vare.cca)
## Test for axes
anova(vare.cca, by="axis", perm.max=500)
## Sequential test for terms
anova(vare.cca, by="terms", permu=200)
## Marginal or Type III effects
anova(vare.cca, by="margin")
## Marginal test knows 'scope'
anova(vare.cca, by = "m", scope="P")Run the code above in your browser using DataLab