Spatial Statistics:  the Mantel Test and Partial Mantel Test 

Spatial statistics is a field of statistics that includes many different tests and techniques.  However, a great majority of the techniques are focused on determining the extent to which data are spatially autocorrelated, or to performing hypothesis tests after accounting for spatial autocorrelation.  Spatial autocorrelation occurs when observations are not independent of one another because of their spatial arrangement. When data are spatially autocorrelated  the value of one observation can be predicted based on adjacent observations.  Spatial autocorrelation violates the assumption of independence of observations which is a serious concern for tradiational hypothesis tests.  Traditionally, random assignment of subjects to treatments is the technique that is most often employed to neutralize the effects of spatial autocorrelation.

ANOVA generally is a common method employed by ecologists to test for treatment effects.  If we consider a field experiment examining the response of plants to some treatment and analyzed by ANOVA, then there are two possible outcomes; detection of significant treament effects or an absence of significant treatment effects.   However, when there are significant treatment effects and spatial autocorrelation is believed to be present, then there are three possible reasons for the significant effect: 1) there is no significant spatial autocorrletaion and the treatments did affect plant response, 2) the degree of spatial autocorrelation is significant and is introducing spurious treatment effects, or 3) both the degree of spatial autocorrelation and the treatment effects are significant.  The Mantel test and Partial Mantel test allow one to distinguish among these three cases by assessing the extent of spatial autocorrelation among subjects.

 Mantel Test

The Mantel test computes a correlation between two n by n distance matrices, where one matrix might represent spatial distances, for example, while the other represents differences between pairs of plants in some measure of plant status (e.g., mass).  The null hypothesis is that the observed relationship between the two distance matrices could have been obtained by any random arrangement in space (or time, or treatment assignment) of the observations through the study area.

Thus, the results of the test will reveal whether small plants are located near other small plants, while large ones will have large neighbors.  The null hypothesis is no relationship between spatial location and plant size.

The matrices will be square and thus the calculations for the test are carried out on only the upper or lower diagonal of the matrices.  Again, the values of the two matrices are distance measurements between pairs of values measured in the field (location, mass, height, etc.).

The computation yields a Z statistic:

where A and B are the distance matrices.

More commonly this statistic is normalized via a standard normal transformation where the mean of the matrix is subtracted from each element and then each element is divided by the standard deviation.  This yields a r statistic:

The significance of the test statistic can be assessed by one of two methods.  A permutation test is recommended with small sample sizes (n< 20).   However, with small sample sizes it is difficult to detect significant spatial patterns.  Large sample sizes (n>40) can be tested for significance by an asymptotic t-approximation where the test statistic is transformed into a t statistic.   A significant result indicates spatial autocorrelation.


Partial Mantel Test

While the Mantel test only allows a comparison among two variables, a Partial Mantel test can be used to compare three or more variables.  Essentially, the Partial Mantel test allows a comparison to be made among two variables while controlling for the third.  To accomplish this, a third matrix (C) is created that can be another variable or a design matrix that refers to the experimental design (such as treatment or not or which of 3 treatments an observation receives).  Remember, this matrix is also a matrix of distance (or difference) measurements.

The test statistic is calculated by constructing a matrix of residuals, A’, of the regression between A and C, and a matrix of residuals, B’, of the regression between B and C.  The two residual matrices, A’ and B’, are then compared by a standard Mantel test.

Calculations of these test statistics is laborious and is usually carried out by a computer.  Pierre Legendre has written a relatively comprehensive spatial statistics program for the Macintosh, “R package: multidimensional analysis, spatial analysis” that is available for free for download from the website listed below.  Numerous other programs are also available for download that will also compute a Mantel test.


The spatial statistics literature is notoriously difficult to understand and penetrate.  During the course of preparing this section, I consulted many sources, very few of which were of use.  The references listed below are the most readable to the sources I consulted.

Cressie, N. A. C., 1993.  Statistics for Spatial Data.  John Wiley and Sons, Inc.

Fortin, M., and J. Gurevitch.  1993.  Mantel Tests: Spatial Structure in Field Experiments: in Design and Analysis of Ecological Experiments by Scheiner, S.M., and J. Gurevitch.  Chapman & Hall.

Legendre, P. and M. Fortin.  1989.  Spatial pattern and ecological analysis.  Vegetatio 80:107-138.

Ver Hoef, J.M., and N. Cressie.  1993.  Spatial Statistics: Analysis of Field Experiments: in Design and Analysis of Ecological Experiments by Scheiner, S.M., and J. Gurevitch.  Chapman & Hall.



Pierre Legendre’s website for spatial statistics and R-package:

Richard Davis’ website for his course on Spatial Statistics at Colorado State.  Has a very good bibliography.  In addition, there is a reader for the course.