localmoran {spdep} | R Documentation |
The local spatial statistic Moran's I is calculated for each zone based on the spatial weights object used. The values returned include a Z-value, and may be used as a diagnostic tool. The statistic is:
I_i = frac{(x_i-bar{x})}{{sum_{k=1}^{n}(x_k-bar{x})^2}/n}{sum_{j=1}^{n}w_{ij}(x_j-bar{x})}
, and its expectation and variance are given in Anselin (1995).
localmoran(x, listw, zero.policy=FALSE, spChk=NULL)
x |
a numeric vector the same length as the neighbours list in listw |
listw |
a listw object created for example by nb2listw |
zero.policy |
if TRUE assign zero to the lagged value of zones without neighbours, if FALSE assign NA |
spChk |
should the data vector names be checked against the spatial objects for identity integrity, TRUE, or FALSE, default NULL to use get.spChkOption() |
Ii |
local moran statistic |
E.Ii |
expectation of local moran statistic |
Var.Ii |
variance of local moran statistic |
Z.Ii |
standard deviate of local moran statistic |
Roger Bivand Roger.Bivand@nhh.no
Anselin, L. 1995. Local indicators of spatial association, Geographical Analysis, 27, 93115; Getis, A. and Ord, J. K. 1996 Local spatial statistics: an overview. In P. Longley and M. Batty (eds) Spatial analysis: modelling in a GIS environment (Cambridge: Geoinformation International), 261277.
data(afcon) oid <- order(afcon$id) resI <- localmoran(spNamedVec("totcon", afcon), nb2listw(paper.nb)) print(data.frame(resI[oid,], row.names=afcon$name[oid]), digits=2) resG <- localG(spNamedVec("totcon", afcon), nb2listw(include.self(paper.nb))) print(data.frame(resG[oid], row.names=afcon$name[oid]), digits=2)