Moran's I is one of the oldest statistics used to examine spatial autocorrelation. This global statistic was first proposed by Moran (1948, 1950). Later, Cliff and Ord (1973, 1981) present a comprehensive work on spatial autocorrelation and suggested a formula to calculate the I which is now used in most textbooks and software: $$I = (n/W)*(\Sigma \Sigma w_{ij}*z_i*z_j/ \Sigma z_i^2)$$ where \(n\) is number of observations, \(W\) is the sum of the weights w_ij for all pairs in the system, \(z_i=x_i - mean(x)\) where \(x\) is the value of the variable at location \(i\) and \(mean(x)\) the mean value of the variable in question (Eq. 5.2 Kalogirou, 2003).The implementation here allows only nearest neighbour weighting schemes. Resampling and randomization null hypotheses have been tested following the discussion of Goodchild (1986, pp. 24-26).
moransI(Coords, Bandwidth, x, WType = 'Binary')
Returns the weights matrix, the calculated Moran's I and a list of statistics for the latter's inference: the expected I (E[I]), z scores and p values for both resampling and randomization null hypotheses.
Weights Matrix
Classic global Moran's I statistic
The Expected Moran's I \((E[I]=-1/(n-1))\)
The z score calculated for the resampling null hypotheses test
The z score calculated for the randomization null hypotheses test
The p-value (two-tailed) calculated for the resampling null hypotheses test
The p-value (two-tailed) calculated for the randomization null hypotheses test
a numeric matrix or vector or data frame of two columns giving the X,Y coordinates of the observations (data points or geometric / population weighted centroids)
a positive integer that defines the number of nearest neighbours for the calculation of the weights
a numeric vector of a variable
a string giving the weighting scheme used to compute the weights matrix. Options are: "Binary" and "Bi-square". Default is "Binary".
Binary: weight = 1 for distances less than or equal to the distance of the furthest neighbour (H), 0 otherwise;
Bi-square: \(weight = (1-(ndist/H)^2)^2\) for distances less than or equal to H, 0 otherwise.
Stamatis Kalogirou <stamatis.science@gmail.com>
The Moran's I statistic ranges from -1 to 1. Values in the interval (-1, 0) indicate negative spatial autocorrelation (low values tend to have neighbours with high values and vice versa), values near 0 indicate no spatial autocorrelation (no spatial pattern - random spatial distribution) and values in the interval (0,1) indicate positive spatial autocorrelation (spatial clusters of similarly low or high values between neighbour municipalities should be expected.)
Anselin, L., I. Syabri and Y Kho., 2006, GeoDa: An Introduction to Spatial Data Analysis. Geographical Analysis 38(1), 5-22.
Bivand et al., 2014, spdep: Spatial dependence: weighting schemes, statistics and models, http://cran.r-project.org/web/packages/spdep/index.html
Cliff, A.D., and Ord, J.K., 1973, Spatial autocorrelation (London: Pion).
Cliff, A.D., and Ord, J.K., 1981, Spatial processes: models and applications (London: Pion).
Goodchild, M. F., 1986, Spatial Autocorrelation. Catmog 47, Geo Books.
Moran, P.A.P., 1948, The interpretation of statistical maps, Journal of the Royal Statistics Society, Series B (Methodological), 10, 2, pp. 243 - 251.
Moran, P.A.P., 1950, Notes on continuous stochastic phenomena, Biometrika, 37, pp. 17 - 23.
Kalogirou, S. (2003) The Statistical Analysis and Modelling of Internal Migration Flows within England and Wales, PhD Thesis, School of Geography, Politics and Sociology, University of Newcastle upon Tyne, UK. https://theses.ncl.ac.uk/jspui/handle/10443/204
Kalogirou, S. (2015) Spatial Analysis: Methodology and Applications with R. [ebook] Athens: Hellenic Academic Libraries Link. ISBN: 978-960-603-285-1 (in Greek). https://repository.kallipos.gr/handle/11419/5029?locale=en
Paradis et al., 2014, ape: Analyses of Phylogenetics and Evolution, https://CRAN.R-project.org/package=ape
data(GR.Municipalities)
attr<-GR.Municipalities@data
m.I<-moransI(cbind(attr$X, attr$Y),6,attr$UnemrT01)
t(as.matrix(m.I[2:7]))
Run the code above in your browser using DataLab