2
$\begingroup$

I want to check spatial correlation for my data about fecal coliform values in water measured at different location. For this I have tried both Moran.I and the Mantel test. They are giving different results.

    bod  cod totalcoliform fecalcoliform  tkn      WQI      lat     long
1  1.20  5.0       1.9e+02             7 0.00 48.15531 28.76796 78.14042
2  1.40  6.0       2.8e+00             9 0.00 43.44091 28.75740 78.14653
3  1.10  5.0       1.7e+02             9 0.50 49.36114 29.94216 78.15635
4  1.10  5.0       1.7e+02             9 0.50 48.32624 29.94747 78.16174
5  1.10  0.0       1.5e+02            80 0.50 50.24674 29.95648 78.17104
6  1.10  5.0       1.7e+02             9 0.50 48.43844 29.97876 78.19053
7  1.00  4.0       1.1e+02             6 0.50 48.02532 30.04806 78.27317
8  0.90  3.0       9.0e+00             4 0.50 47.49982 30.12417 78.31675
9  1.40 14.0       3.0e+02            80 1.30 40.81839 27.39914 79.62756
10 3.60 30.0       5.0e+04          1700 2.98 43.41175 27.49811 79.69600
11 2.80 34.0       2.3e+03           130 6.11 42.76469 27.02089 79.97436
12 3.40 36.0       3.5e+03             5 4.90 42.73780 27.01589 79.97927
13 3.40 32.0       1.4e+04          5000 4.54 41.89651 27.01138 79.98612
14 1.20 24.0       2.8e+04          5000 3.40 43.66054 26.61381 80.27518
15 3.80 24.0       5.0e+04          1300 3.05 43.70037 26.47381 80.37561
16 6.80 52.0       3.0e+06        170000 4.50 39.74132 26.42900 80.41319
17 5.40 49.0       1.6e+06        500000 5.40 41.66846 26.40578 80.45100
18 2.00 14.2       2.4e+04          5000 0.00 44.10941 25.56364 83.94472
19 1.80 14.1       2.4e+04          5000 0.00 50.86373 25.72989 84.13955
20 1.60  8.1       3.0e+04          8000 0.00 51.65513 25.73247 84.14008
21 3.40 19.3       1.6e+05         50000 0.00 46.31371 25.77825 84.69819
22 1.60  4.1       5.0e+03          2300 0.00 52.39509 25.57722 84.79964
23 3.80 30.4       1.6e+05         50000 0.00 43.72464 25.73546 84.81149
24 2.30 12.4       3.0e+04          8000 0.00 45.51882 25.64829 85.05118
25 1.50  5.5       2.2e+04         13000 0.00 47.02308 25.72091 85.18613
26 1.70  6.2       2.2e+04          7000 0.00 46.53787 25.68144 85.19344
27 2.80 17.9       9.0e+04         24000 0.00 46.96669 25.59889 85.24377
28 2.30  5.9       3.0e+04         13000 0.00 49.28170 25.05751 87.83943
29 3.20 48.0       6.0e+04         17000 1.88 40.51738 22.46906 88.11670
30 2.45 26.0       2.6e+04         14000 0.94 46.08783 22.46819 88.11979
31 1.30 16.0       9.0e+03          1100 5.64 49.52317 24.10055 88.24425
32 1.90 28.0       3.4e+04         11000 2.82 44.33690 22.65517 88.35397
33 3.20 36.0       4.2e+04         17000 0.94 42.37291 22.65517 88.35397
34 4.10 32.0       6.0e+04         19000 3.76 47.02540 22.80048 88.35726

I am considering the parameter "fecalcoliform".

My R code (I have stored the data in a data.frame called 'selJ9'):

#Moran's I spatial correlation test

dists <- as.matrix(dist(cbind(selJ9$long, selJ9$lat)))
dists.inv <- 1/dists
diag(dists.inv) <- 0


dists.inv[is.infinite(dists.inv)] <- 0
Moran.I(selJ9$fecalcoliform, dists.inv)

RESULT:

$observed
[1] 0.2159954

$expected
[1] -0.03030303

$sd
[1] 0.06476884

$p.value
[1] 0.00014311

Here I am rejecting the null hypothesis as p value is significant and I can say there is spatial correlation for measured values of fecal coliform.

# mantel test

station.dists <- dist(cbind(selJ9$long, selJ9$lat))
parameter.dists <- dist(selJ9$fecalcoliform)

mantel.rtest(station.dists, parameter.dists, nrepet = 9999)

RESULT:

Monte-Carlo test
Observation: -0.06527576 
Call: mantel.rtest(m1 = station.dists, m2 = parameter.dists, nrepet = 9999)
Based on 9999 replicates
Simulated p-value: 0.7132 
Warning messages:
1: In is.euclid(m1) : Zero distance(s)
2: In is.euclid(m2) : Zero distance(s)
3: In is.euclid(distmat) : Zero distance(s)

For the same data, the mantel test is returning a p value which is non-significant hence failing to reject the null hypothesis.

Please let me know which result is acceptable. Or if I am going wrong somewhere.

$\endgroup$
  • $\begingroup$ Don't they test for different types of spatial autocorrelation? $\endgroup$ – gung Feb 22 '15 at 22:52
  • $\begingroup$ Why would these be expected to be the same? $\endgroup$ – Glen_b Jan 17 '16 at 2:26
  • $\begingroup$ Perhaps this UCLA page has the clue. $\endgroup$ – mdewey Dec 13 '16 at 14:09
1
$\begingroup$

I am not too familiar with these tests, but the very fact that two different tests exist for a given testing problem pretty much indicates that there should sometimes be conflicting outcomes between them. (I am for instance familiar with this "problem" from the econometric unit root testing problem.)

Else, why would both continue to be in use if they always give the same result? People would quickly (presumably) settle on the one that is easier to compute and/or more "intuitive".

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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