Moran's I test for residual spatial autocorrelation
Moran's I test for residual spatial autocorrelation
Moran's I test for spatial autocorrelation in residuals from an estimated linear model (lm()).
lm.morantest(model, listw, zero.policy=attr(listw,"zero.policy"), alternative ="greater", spChk=NULL, resfun=weighted.residuals, naSubset=TRUE)
Arguments
model: an object of class lm returned by lm; weights may be specified in the lm fit, but offsets should not be used
listw: a listw object created for example by nb2listw
zero.policy: default attr(listw, "zero.policy") as set when listw was created, if attribute not set, use global option value; if TRUE assign zero to the lagged value of zones without neighbours, if FALSE assign NA
alternative: a character string specifying the alternative hypothesis, must be one of "greater" (default), "less" or "two.sided".
spChk: should the data vector names be checked against the spatial objects for identity integrity, TRUE, or FALSE, default NULL to use get.spChkOption()
resfun: default: weighted.residuals; the function to be used to extract residuals from the lm object, may be residuals, weighted.residuals, rstandard, or rstudent
naSubset: default TRUE to subset listw object for omitted observations in model object (this is a change from earlier behaviour, when the model$na.action component was ignored, and the listw object had to be subsetted by hand)
Returns
A list with class htest containing the following components: - statistic: the value of the standard deviate of Moran's I.
p.value: the p-value of the test.
estimate: the value of the observed Moran's I, its expectation and variance under the method assumption.
alternative: a character string describing the alternative hypothesis.
method: a character string giving the method used.
data.name: a character string giving the name(s) of the data.
References
Cliff, A. D., Ord, J. K. 1981 Spatial processes, Pion, p. 203,