NY_data {spdep} | R Documentation |
New York leukemia data taken from the data sets supporting Waller and Gotway 2004.
data(NY_data)
A data frame with 281 observations on the following 12 variables, and the binary coded spatial weights used in the source.
AREANAME
AREAKEY
X
Y
POP8
TRACTCAS
PROPCAS
PCTOWNHOME
PCTAGE65P
Z
AVGIDIST
PEXPOSURE
The examples section shows how the DBF files from the book website for Chapter 9 were converted into the nydata
data frame and the listw_NY
spatial weights list.
http://www.sph.emory.edu/~lwaller/ch9index.htm
Waller, L. and C. Gotway (2004) Applied Spatial Statistics for Public Health Data. New York: John Wiley and Sons.
## Not run: ## NY leukemia require(foreign) nydata <- read.dbf("nydata.dbf") nyadjmat <- as.matrix(read.dbf("nyadjwts.dbf")[-1]) ID <- as.character(names(read.dbf("nyadjwts.dbf"))[-1]) identical(substring(ID, 2, 10), substring(as.character(nydata$AREAKEY), 2, 10)) nyadjlw <- mat2listw(nyadjmat, as.character(nydata$AREAKEY)) listw_NY <- nb2listw(nyadjlw$neighbours, style="B") ## End(Not run)