Skip to content
Prev 25274 / 29559 Next

Moran Index n ape and spdep package

Good morning at all, I'm new on R and also I'm not so practical with 
spatial analysis by Moran index. So, I've some practice in kriging to 
interpolate adn before to judge by variogram effective spatial 
autocorrelation of my actual data resolution.
Recently I've discover Moran index that give me, it seems, a sound 
statistical judgment about effective autocorrelation and perhaps spatial 
continuity.

I've used "ape" package to perform a Moran evaluation by simple weight  
by inverse distance
library("ape")
View(myData) (X, Y, Z attribute of pollutant concentration)
myData.dists <- as.matrix(dist(cbind(myData$X,myData$Y)))
myData.dists.inv <- 1/myData.dists
diag(myData.dists.inv) <- 0
Moran.I(myData$PCE,myData.dists.inv)

Forgive my difficulties but I can not play a similar syntax with 
"spdep". Example are not clear for me.

Can you show me an example ?

Thank you very much in advance

Stefano