mantel
finds the Mantel statistic as a matrix
correlation between two dissimilarity matrices, and function
mantel.partial
finds the partial Mantel statistic as the
partial matrix correlation between three dissimilarity matrices. The
significance of the statistic is evaluated by permuting rows and
columns of the first dissimilarity matrix. mantel(xdis, ydis, method="pearson", permutations=999, strata = NULL, na.rm = FALSE, parallel = getOption("mc.cores"))
mantel.partial(xdis, ydis, zdis, method = "pearson", permutations = 999, strata = NULL, na.rm = FALSE, parallel = getOption("mc.cores"))
dist
objects. cor
:
"pearson"
, "spearman"
or "kendall"
. how
, or the
number of permutations required, or a permutation matrix where each
row gives the permuted indices.parallel = 1
uses ordinary, non-parallel
processing. The parallel processing is done with parallel
package.mantel
with following
components:permutations
for additional details on permutation tests
in Vegan. Partial Mantel statistic uses partial correlation
conditioned on the third matrix. Only the first matrix is permuted so
that the correlation structure between second and first matrices is
kept constant. Although mantel.partial
silently accepts other
methods than "pearson"
, partial correlations will probably be
wrong with other methods.
The function uses cor
, which should accept
alternatives pearson
for product moment correlations and
spearman
or kendall
for rank correlations.
Legendre, P. and Legendre, L. (2012) Numerical Ecology. 3rd English Edition. Elsevier.
cor
for correlation coefficients,
protest
(``Procrustes test'') for an alternative with
ordination diagrams, anosim
and mrpp
for comparing dissimilarities against
classification. For dissimilarity matrices, see vegdist
or dist
. See bioenv
for selecting
environmental variables. ## Is vegetation related to environment?
data(varespec)
data(varechem)
veg.dist <- vegdist(varespec) # Bray-Curtis
env.dist <- vegdist(scale(varechem), "euclid")
mantel(veg.dist, env.dist)
mantel(veg.dist, env.dist, method="spear")
Run the code above in your browser using DataLab