Dear all,

I am looking at the example in spdep for autocorrelation test as below. 
However, 
how can one create a nb object for your data? Suppose you have data COL.OLD. 
But 
how do you create COL.nb from there? Many thanks for your help!

Bill

#######################################################
library(spdep)

data(oldcol)

dim(COL.OLD)
head(COL.OLD)

geary.test(COL.OLD$CRIME, nb2listw(COL.nb, style="W"))
geary.test(COL.OLD$CRIME, nb2listw(COL.nb, style="W"),
 randomisation=FALSE)

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to