Learn R Programming

vegan (version 1.6-0)

mantel: Mantel Test for Two Dissimilarity Matrices

Description

Function mantel finds the Mantel statistic as a matrix correlation between two dissimilarity matrices, and evaluates the significance of the statistic by permuting rows and columns of the dissimilarity matrix. The statistic is evaluated either as a moment correlation or as a rank correlation.

Usage

mantel(xdis, ydis, method="pearson", permutations=1000, strata)

Arguments

xdis
First dissimilarity matrix or a dist object.
ydis
Second dissimilarity matrix or a dist object.
method
Correlation method, as accepted by cor.test: pearson, spearman or kendall.
permutations
Number of permutations in assessing significance.
strata
An integer vector or factor specifying the strata for permutation. If supplied, observations are permuted only within the specified strata.

Value

  • The function returns a list of class mantel with following components:
  • CallFunction call.
  • methodCorrelation method used, as returned by cor.test.
  • statisticThe Mantel statistic.
  • signifEmpirical significance level from permutations.
  • permA vector of permuted values.
  • permutationsNumber of permutations.

Details

Mantel statistic is simply a correlation between entries of two dissimilarity matrices (some use cross products, but these are linearly related). However, the significance cannot be directly assessed, because there are $N(N-1)/2$ entries for just $N$ observations. Mantel developed asymptotic test, but here we use permutations of $N$ rows and columns of dissimilarity matrix.

The function uses cor.test, which should accept alternatives pearson for product moment correlations and spearman or kendall for rank correlations.

References

The test is due to Mantel, of course, but the current implementation is based on Legendre and Legendre.

Legendre, P. and Legendre, L. (1998) Numerical Ecology. 2nd English Edition. Elsevier.

See Also

cor.test for correlation tests, protest (``Procrustes test'') for an alternative with ordination diagrams, and anosim for comparing dissimilarities against classification. For dissimilarity matrices, see vegdist or dist.

Examples

Run this code
## 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