The Mantel test (Mantel, 1967) may be used to calculate correlations between corresponding positions of two (dis)similarity or distance matrices (Figure 1) derived from either multi- or univariate data. Non-redundant portions of these matrices (e.g. the lower or upper triangle of symmetrical matrices, excluding the diagonals) are 'unfolded' into column vectors and a correlation calculated between these vectors. The matrices being tested must be calculated from data sets with the same objects, but with variables that are independent of one another. It is also possible to substitute one data set with a matrix representation of a hypothetical classification or gradient (see Model testing, below). The Mantel test can test null hypotheses of the kind:
Null hypothesis:
Null hypothesis:
(with a matrix of response data and a matrix of geographic distances)
The distances among objects in a matrix of response variables are not linearly correlated with another matrix of explanatory variables.
The response data matrix is not structured along a spatial gradient.
Figure 1: The Mantel test finds correlations between (dis)similarity matrices. a) A Bray-Curtis dissimilarity matrix calculated for species response data at four samples. b) A Euclidean distance matrix calculated for a set of standardised environmental parameters at the same four samples as a). In this toy example, the Mantel statistic rM, based on Pearson's product-moment correlation, is approximately -0.14 and is not significant. Naturally, many more samples are required for adequate significance testing.
zM
rM
rankedM
The Mantel statistic, zM, is computed by adding the cross products of the two (dis)similarity matrices being tested. As (dis)similarity matrices are symmetrical about their diagonals, half of each matrix (excluding values on the diagonal) is unfolded (i.e. vectorised by stacking the values in each row below those of the previous the row) in order to compute their cross products.
Calculated similarity to zM, however, values in the unfolded matrices are standardised before cross product computation. Thus, rM falls between -1 and 1, similar to a correlation coefficient.
A ranked Mantel statistic may also be computed by converting distances into ranks before computing rM. The correlations that result from this are comparable to the non-parametric, Spearman correlations.
The Mantel approach can also be used to test a hypothesis or a model. In this model testing approach, one matrix contains response data, while the other contains a representation of an a priori model to test. The 'model matrix' thus represents the alternative hypothesis of the test. If significant Mantel statistics are found, they provide some support for the model.
The model matrix may be a classification of objects into groups formatted to resemble a (dis)similarity matrix. In this case, the Mantel test is equivalent to a non-parametric MANOVA (NPMANOVA). The model matrix may also be a quantitative representation of a hypothetical gradient.
Figure 2: The Mantel test can be used to test an a priori model or hypothesis. a) A Bray-Curtis dissimilarity matrix calculated for species response data at four sites. b) A model dissimilarity matrix asserting that samples 1 and 2 are maximally dissimilar from samples 3 and 4 and both pairs are maximally similar. This asserts that samples 1 and 2, and samples 3 and 4, form two distinct groups.
Mantel statistics are tested for significance by permutation. Rows and columns of either distance matrix (but not both matrices) can be permuted and a Mantel statistic recomputed each time to determine the expected distribution of the statistic under the null hypothesis. Observing where the value of the statistic calculated from the observed data falls in the permuted distribution allows one to assess the likelihood of the observed correlation arising by chance. Note, however, that the permutation of values in a (dis)similarity matrix is not completely random, but should actually reflect a permutation of the raw data followed by the calculation of a new (dis)similarity matrix.
Unless using the ranked Mantel statistic, the Mantel approach is suited to detect linear relationships between (dis)similarity matrices.
Response and explanatory variables must be independent. That is, each matrix must represent a different data set. If one matrix is in any way derived from the other, the test is invalid.
It is recommended that the Mantel test should be used only for hypotheses framed in terms of (dis)similarity or distance between pairs of objects (See Legendre et al., [2005] for discussion). If hypotheses references raw data, consider constrained analyses such as redundancy analysis (RDA) or canonical correspondence analysis (CCA).
The Mantel test is not suited to detect non-linear relationships between (dis)similarity matrices.
Be aware if you are testing similarity or dissimilarity matrices and interpret your results accordingly.
Do not test a model derived from a data set on the same data set. In this scenario, the hypothesis and the model are not independent. This is an example of data dredging.
Be aware that a Mantel correlelogram uses repeated Mantel tests to (usually) check for spatial or temporal autocorrelation. The interpretation is somewhat different to the standard Mantel test.
R
The mantel.test() function in the package ape
Legendre P, Legendre L. Numerical Ecology. 2nd ed. Amsterdam: Elsevier, 1998. ISBN 978-0444892508.
Legendre P, Borcard D, Peres-Neto PR (2005) Analyzing beta diversity: Partitioning the spatial variation of community composition data. Ecol Monogr. 75:435–450.
Mantel NA (1967) The detection of disease clustering and a generalized regression approach. Cancer Res. 27: 209-220.