Solved – Mantel test or/and correlation test

correlationhypothesis testing

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?

Best Answer

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.

Related Question