A decomposition of the Moran coefficient in order to separately test for the simultaneous presence of positive and negative autocorrelation in a variable.
MI.decomp(x, W, nsim = 100)
a vector or matrix
spatial connectivity matrix
number of iterations to simulate the null distribution
Returns a data.frame
that contains the following information
for each variable:
I+
observed value of Moran's I (positive part)
VarI+
variance of Moran's I (positive part)
pI+
simulated p-value of Moran's I (positive part)
I-
observed value of Moran's I (negative part)
VarI-
variance of Moran's I (negative part)
pI-
simulated p-value of Moran's I (negative part)
pItwo.sided
simulated p-value of the two-sided test
If x
is a matrix, this function computes the Moran
test for spatial autocorrelation for each column.
The p-values calculated for I+
and I-
assume
a directed alternative hypothesis. Statistical significance is assessed
using a permutation procedure to generate a simulated null distribution.
Dary, Stéphane (2011): A New Perspective about Moran’s Coefficient: Spatial Autocorrelation as a Linear Regression Problem. Geographical Analysis, 43 (2): pp. 127 - 141.
data(fakedata)
X <- cbind(fakedataset$x1, fakedataset$x2,
fakedataset$x3, fakedataset$negative)
(MI.dec <- MI.decomp(x = X, W = W, nsim = 100))
#> I+ VarI+ pI+ I- VarI- pI-
#> 1 0.3894789 0.002064278 0.00990099 ** -0.0783007 0.001798007 1.00000000
#> 2 0.3048369 0.001790553 0.00990099 ** -0.1360794 0.002070329 0.97029703
#> 3 0.2247566 0.001963019 0.29702970 -0.2156438 0.002326726 0.47524752
#> 4 0.1131614 0.002086170 1.00000000 -0.3572259 0.002051660 0.00990099 **
#> pItwo.sided
#> 1 0.01980198 *
#> 2 0.01980198 *
#> 3 0.59405941
#> 4 0.01980198 *
# the sum of I+ and I- equals the observed Moran coefficient:
I <- MI.vec(x = X, W = W)[, "I"]
cbind(MI.dec[, "I+"] + MI.dec[, "I-"], I)
#> I
#> [1,] 0.311178214 0.311178214
#> [2,] 0.168757531 0.168757531
#> [3,] 0.009112739 0.009112739
#> [4,] -0.244064424 -0.244064424