Do you know the difference between the Mantel test and a Pearson correlation test? I know that in the Mantel test we look for a correlation between two matrices and in a Pearson test, a correlation between two dataframes.

Thus, which method of correlation is used in the Mantel test?

For example:

#       x        y

#A-B    12      0.12
#A-C    5       0.45
#A-D    8       0.69
#A-E    10      0.1
#B-C    4       0.17
#B-D    1       0.3
#C-D    7       0.36     

A,B,C,D,E represent one site. "x" is the genetic distance between sites (e.g. A-B, A-C, A-D ...) and "y" is the geographical distance between sites.

I want apply a Mantel test between those two columns. Is this the same as applying a Pearson correlation test between the two columns?


1 Answer 1


First, let's clear up some terminology: the term "data frame" doesn't refer to anything mathematical. It's a data structure in R and Pandas for working with tabular data. For statistical questions, I think it's better to think of data frames and matrices as interchangeable.

Second, Pearson correlation is defined on vectors. You're probably thinking of a correlation matrix, which is a matrix of pairwise correlations between more than two vectors, such as the vectors representing different variables in a tabular data set (which you could in turn represent in R as a data frame). The Pearson correlation test is likewise defined on vectors.

Meanwhile the Mantel test is defined on true matrices. However it is actually intended for use specifically on distance matrices, which are derived from data vectors. So both the Pearson correlation test and Mantel test can be used to test relationships between vectors. The difference lies in the question that each test is designed to answer. The Pearson correlation test answers something like the question

When $X$ goes up, does $Y$ also go up? When $X$ goes down, does $Y$ also go down?

while the Mantel test answers something like the question

When any two $X$ observations are similar, are the corresponding $Y$ observations also similar? When any two $X$ observations are dissimilar, are the corresponding $Y$ observations also dissimilar?

There's a very nice explanation of Mantel's test here.

To answer the second part of your question: Pearson's correlation coefficient is used "under the hood" in both tests. It's just used differently.

  • $\begingroup$ Nice corrections! I think you answered to my question. But i want to specify the situation that I 'm facing. I have to do a Mantel test between a genetic distance matrix and a geographical distance matrix. I discovered that whther I use all the values of the matrices, I gonna obtain a bias in the results. Thus, the right thing to do is to select the sites that are geographical close according to some criteria.... In this way I obtained two vectors: one with genetic distance between those sites and another with the geographic distance among them. Can I use a Pearson correlation test? $\endgroup$ Dec 5, 2015 at 16:06
  • $\begingroup$ @user29859 I'm not sure I understand your technique. What does each element of each vector correspond to? $\endgroup$ Dec 5, 2015 at 21:36
  • $\begingroup$ I have two vectors (i.e. two columns of values). One column correspond to the genetic distance between two geographical sites. The other column corresponds to the respective geographical distance between the two sites. My ain is to do the Mantel test between those two columns. $\endgroup$ Dec 6, 2015 at 14:50
  • $\begingroup$ @CafféSospeso so you have several observations at each site? Would you mind adding a "mock up" of the data to your post? $\endgroup$ Dec 6, 2015 at 21:03
  • $\begingroup$ I added a mock up. $\endgroup$ Dec 8, 2015 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.