The mantel
function calculates the Mantel statistic, which quantifies the correlation between two dissimilarity matrices. It also assesses the significance of this correlation by performing permutations of the rows and columns of one of the dissimilarity matrices.
Purpose of the Mantel Test
The Mantel test is used to determine if there is a statistically significant correlation between two distance or dissimilarity matrices. These matrices represent pairwise relationships between the same set of objects, but based on different criteria. For example, one matrix might represent geographic distances between locations, while the other represents ecological distances (differences in species composition) between the same locations. The Mantel test then asks: are locations that are geographically closer also more ecologically similar?
How the mantel
Function Works
-
Dissimilarity Matrices: The function takes two dissimilarity matrices as input. These matrices represent pairwise distances or dissimilarities between objects.
-
Mantel Statistic Calculation: It calculates a correlation coefficient (the Mantel statistic) between the two matrices. This statistic reflects the degree of similarity between the patterns of distances in the two matrices. The correlation can be calculated either as a moment correlation (Pearson correlation) or a rank correlation (Spearman correlation).
-
Permutation Testing: To assess the statistical significance of the observed Mantel statistic, the function performs a permutation test. This involves repeatedly shuffling the rows and columns of one of the matrices and recalculating the Mantel statistic for each permutation.
-
P-value Estimation: The p-value is estimated by comparing the observed Mantel statistic to the distribution of Mantel statistics obtained from the permutations. A small p-value suggests that the observed correlation is unlikely to have occurred by chance, indicating a statistically significant relationship between the two dissimilarity matrices.
Key Features
- Correlation Type: The
mantel
function typically allows you to choose between Pearson (moment) and Spearman (rank) correlation coefficients. - Permutation Scheme: The specific permutation method used can also be controlled. A common approach is to permute the rows and corresponding columns of one matrix.
- Number of Permutations: The number of permutations performed affects the accuracy of the p-value estimate. A larger number of permutations generally leads to a more accurate p-value.
- P-value Calculation: The function returns a p-value indicating the probability of observing a Mantel statistic as extreme as, or more extreme than, the observed value if there were no true association between the matrices.
Example Use Case (Conceptual)
Imagine studying the relationship between genetic distance and geographic distance among populations of a species.
- Matrix 1: Genetic Distance: You create a matrix where each cell (i, j) represents the genetic distance between population i and population j.
- Matrix 2: Geographic Distance: You create a second matrix where each cell (i, j) represents the geographic distance between population i and population j.
- Apply
mantel
Function: You use themantel
function to calculate the Mantel statistic and assess its significance. A significant positive correlation would suggest that populations that are geographically closer also tend to be more genetically similar.
Interpretation of Results
- Mantel Statistic Value: A positive Mantel statistic indicates a positive correlation between the two dissimilarity matrices (i.e., objects that are close in one space tend to be close in the other). A negative value indicates a negative correlation (i.e., objects that are close in one space tend to be far apart in the other).
- P-value: The p-value indicates the statistical significance of the Mantel statistic. A small p-value (e.g., p < 0.05) suggests that the observed correlation is statistically significant and unlikely to be due to chance.
In summary, the mantel
function is a valuable tool for assessing the relationship between two sets of pairwise dissimilarities or distances, providing a statistical framework for evaluating the significance of any observed correlation.