nonormmoran {GeoXp}R Documentation

Detection of spatial autocorrelation

Description

The function `nonnormmoran' is used to detect spatial autocorrelation in the residuals $u$ from the least squares model Y=beta X+u. It calculates Moran's I statistic of the residuals based on the gaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation (gaussian version).

Usage

nonormmoran(y, x, W)

Arguments

y vector of size n of dependent variable
x matrix n x p containing explanatory variables
W spatial weight matrix

Details

W is supposed standartized :

I=(n/s)frac(u'Wu)(u'u)

I sim N(E(I),var(I))

let M=(I-X(X'X)^(-1)X')

E(I)=(n/s)frac(tr(MW))(n-k)

d=frac(n-p)(n+p+2)

V(I)=(n/s)^2[tr(MWMW')+tr(MW)^2+(tr(MW))^2]/d-E(I)^2

Z_I=frac(I-E(I))(v(I)^(1/2))

In the case of W is normed, $s=n$ else $s$ is the number of nonzero links

Value

(nobs,nvar,morani,imean,istat,ivar,prob) where `nobs' is the number of observations, `nvar', the number of explanatory variables, `morani' is the Moran's $I$ statistic estimate, `imean' is E(I), ivar is var(I), istat is the normalized Moran's I statistic (corresponding to Z_i), and prob the associated p-value.

Author(s)

Translated into R from Jim Lessage's Spatial Econometrics Toolbox, http://www.spatial-econometrics.com/

References

Aragon Yves, Perrin Olivier, Ruiz-Gazen Anne, Thomas-Agnan Christine (2009), Statistique et Econométrie pour données géoréférencées : modèles et études de cas

See Also

moranplotmap,neighbourmap,makeneighborsw,normw

Examples

# data baltimore
data(baltimore)
W <- makeneighborsw(baltimore$X,baltimore$Y,method="neighbor",4)
# W is not normed
nonormmoran(baltimore$PRICE,baltimore[,14:15],W)
# W is normed
nonormmoran(baltimore$PRICE,baltimore[,14:15],normw(W))

[Package GeoXp version 1.4 Index]