[R] How to create a nb object

From: Bill Hyman <billhyman1_at_yahoo.com>
Date: Wed, 23 Mar 2011 12:11:55 -0700 (PDT)


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_at_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. Received on Wed 23 Mar 2011 - 20:38:42 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 23 Mar 2011 - 20:40:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive