[R-sig-Geo] inconsistent results from moran.test()

Jay Wang zw@ng3603 @end|ng |rom gm@||@com
Fri Mar 8 20:37:20 CET 2019


Hello,

Having my own spatial weight matrix, I converted it to a listw format and
calculated the Moran index. The codes are listed below:

Wod_lw<-mat2listw(Wod)
moran.test(mydata$Ties_processed,Wod_lw, randomisation=TRUE)

However, after I generated a gal file, imported it, converted it back to a
listw file, and re-calculated the Moran index with the following codes, the
results became totally different (0.1624 vs. 0.1942):
write.nb.gal(Wod_lw$neighbours,"Wod.gal")
Wod.gal.nb <- read.gal(file="Wod.gal")
Wod_lw2<-nb2listw(Wod.gal.nb)
moran.test(mydata$Ties_processed,Wod_lw, randomisation=TRUE)
moran.test(mydata$Ties_processed,Wod_lw2, randomisation=TRUE)

I don't know where the problem is. I would appreciate if anyone can help me
with this. Thank you

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list