[R-sig-Geo] Help for spdep package
Saman Monfared
samanmonfared1 at gmail.com
Tue Dec 18 20:36:50 CET 2012
Dear All,
I performed moran I test for all 1-6 neighbors as:
coords<-cbind(data1$x,data1$y)
knn1 <- knearneigh(coords, 1,RANN=F)
knn2 <- knearneigh(coords, 2,RANN=F)
knn3 <- knearneigh(coords, 3,RANN=F)
knn4 <- knearneigh(coords, 4,RANN=F)
knn5 <- knearneigh(coords, 5,RANN=F)
knn6 <- knearneigh(coords, 6,RANN=F)
nb1 <- knn2nb(knn1)
nb2 <- knn2nb(knn2)
nb3 <- knn2nb(knn3)
nb4 <- knn2nb(knn4)
nb5 <- knn2nb(knn5)
nb6 <- knn2nb(knn6)
###### harche mizan p-value kamtar bashad hambastegi bishtar ast
moran.1.m<-moran.test(data1$IMR.m,nb2listw(nb1, style="W"))
moran.2.m<-moran.test(data1$IMR.m,nb2listw(nb2, style="W"))
moran.3.m<-moran.test(data1$IMR.m,nb2listw(nb3, style="W"))
moran.4.m<-moran.test(data1$IMR.m,nb2listw(nb4, style="W"))
moran.5.m<-moran.test(data1$IMR.m,nb2listw(nb5, style="W"))
moran.6.m<-moran.test(data1$IMR.m,nb2listw(nb6, style="W"))
results:
First Second Third Fourth
Fifth Sixth
p-value 0.4053004 0.2749966 0.4010877 0.633948 0.7313581 0.9098516
these p-values indicate week spatial correlations.Also I examine other
style ("B","C",..)
In addition the Moran test for residuals of regression model also
indicates week spatial correlation.my data isn't symmetric
neighbors.Can it make a problem?
What is your suggestion?
--
Saman Monfared
Msc, Department of Statistics, Shiraz University,
Shiraz 71454, Iran
Email: Samanmonfared1 at gmail.com
Tel: +98 917 5305167
More information about the R-sig-Geo
mailing list