Mantel's test is widely used in biological studies to examine the correlation between the spatial distribution of animals (position in space) with, for example, their genetic relatedness, rate of aggression or some other attribute. Plenty of good journals are using it (PNAS, Animal Behaviour, Molecular Ecology...).
I fabricated some patterns which may occur in nature, but Mantel's test seems to be quite useless to detect them. On the other hand, Moran's I had better results (see p-values under each plot).
Why don't scientists use Moran's I instead? Is there some hidden reason I do not see? And if there is some reason, how can I know (how the hypotheses must be constructed differently) to appropriately use Mantel's or Moran's I test? A real-life example will be helpful.
Imagine this situation: There is an orchard (17 x 17 trees) with a crow is sitting on each tree. Levels of "noise" for each crow are available and you are want to know if the spatial distribution of crows is determined by noise they make.
There are (at least) 5 possibilities:
"Birds of a feather flock together." The more similar crows are, the smaller the geographical distance between them (single cluster).
"Birds of a feather flock together." Again, the more similar crows are, the smaller the geographical distance between them, (multiple clusters) but one cluster of noisy crows has no knowledge about the existence of second cluster (otherwise they would fuse into one big cluster).
"Monotonic trend."
"Opposites attract." Similar crows cannot stand each other.
"Random pattern." The level of noise has no significant effect on spatial distribution.
For each case, I created a plot of points and used the Mantel test to compute a correlation (it is no surprise that its results are non-significant, I would never try to find linear association among such patterns of points).
Example data: (compressed as possible)
r.gen <- seq(-100,100,5)
r.val <- sample(r.gen, 289, replace=TRUE)
z10 <- rep(0, times=10)
z11 <- rep(0, times=11)
r5 <- c(5,15,25,15,5)
r71 <- c(5,20,40,50,40,20,5)
r72 <- c(15,40,60,75,60,40,15)
r73 <- c(25,50,75,100,75,50,25)
rbPal <- colorRampPalette(c("blue","red"))
my.data <- data.frame(x = rep(1:17, times=17),y = rep(1:17, each=17),
c1=c(rep(0,times=155),r5,z11,r71,z10,r72,z10,r73,z10,r72,z10,r71,
z11,r5,rep(0, times=27)),c2 = c(rep(0,times=19),r5,z11,r71,z10,r72,
z10,r73,z10,r72,z10,r71,z11,r5,rep(0, times=29),r5,z11,r71,z10,r72,
z10,r73,z10,r72,z10,r71,z11,r5,rep(0, times=27)),c3 = c(seq(20,100,5),
seq(15,95,5),seq(10,90,5),seq(5,85,5),seq(0,80,5),seq(-5,75,5),
seq(-10,70,5),seq(-15,65,5),seq(-20,60,5),seq(-25,55,5),seq(-30,50,5),
seq(-35,45,5),seq(-40,40,5),seq(-45,35,5),seq(-50,30,5),seq(-55,25,5),
seq(-60,20,5)),c4 = rep(c(0,100), length=289),c5 = sample(r.gen, 289,
replace=TRUE))
# adding colors
my.data$Col1 <- rbPal(10)[as.numeric(cut(my.data$c1,breaks = 10))]
my.data$Col2 <- rbPal(10)[as.numeric(cut(my.data$c2,breaks = 10))]
my.data$Col3 <- rbPal(10)[as.numeric(cut(my.data$c3,breaks = 10))]
my.data$Col4 <- rbPal(10)[as.numeric(cut(my.data$c4,breaks = 10))]
my.data$Col5 <- rbPal(10)[as.numeric(cut(my.data$c5,breaks = 10))]
Creating matrix of geographical distances (for Moran's I is inversed):
point.dists <- dist(cbind(my.data$x, my.data$y))
point.dists.inv <- 1/point.dists
point.dists.inv <- as.matrix(point.dists.inv)
diag(point.dists.inv) <- 0
Plot creation:
X11(width=12, height=6)
par(mfrow=c(2,5))
par(mar=c(1,1,1,1))
library(ape)
for (i in 3:7) {
my.res <- mantel.test(as.matrix(dist(my.data[ ,i])), as.matrix(point.dists))
plot(my.data$x,my.data$y,pch=20,col=my.data[ ,c(i+5)], cex=2.5, xlab="",
ylab="", xaxt="n", yaxt="n", ylim=c(-4.5,17))
text(4.5, -2.25, paste("Mantel's test", "\n z.stat =", round(my.res$z.stat,
2), "\n p.value =", round(my.res$p, 3)))
my.res <- Moran.I(my.data[ ,i], point.dists.inv)
text(12.5, -2.25, paste("Moran's I", "\n observed =", round(my.res$observed,
3), "\n expected =",round(my.res$expected,3), "\n std.dev =",
round(my.res$sd,3), "\n p.value =", round(my.res$p.value, 3)))
}
par(mar=c(5,4,4,2)+0.1)
for (i in 3:7) {
plot(dist(my.data[ ,i]), point.dists,pch = 20, xlab="geographical distance",
ylab="behavioural distance")
}
P.S. in the examples on UCLA's statistics help website, both tests are used on the exact same data and the exact same hypothesis, which is not very helpful (cf., Mantel test, Moran's I).
Response to I.M. You have write:
...it [Mantel]tests whether quiet crows are located near other quiet crows, while noisy crows have noisy neighbors.
I think that such hypothesis could NOT be tested by Mantel test. On both plots the hypothesis valid. But if you suppose that one cluster of not noisy crows may not have knowledge about the existence of second cluster of not noisy crows - Mantels test is again useless. Such separation should be very probable in nature (mainly when you are doing data collection on larger scale).