nydata: New York leukemia data

Description Usage Format Details Source References Examples

Description

New York leukemia data taken from the data sets supporting Waller and Gotway 2004 (the data should be loaded by running example(NY_data) to demonstrate spatial data import techniques)

Usage

1

Format

A data frame with 281 observations on the following 12 variables, and the binary coded spatial weights used in the source.

Details

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. The shapes directory includes the original version of the UTM18 census tract boundaries imported from BNA format (http://sedac.ciesin.columbia.edu/ftpsite/pub/census/usa/tiger/ny/bna_st/t8_36.zip) before the OGR/GDAL BNA driver was available. The NY8_utm18 shapefile was constructed using a bna2mif converter and converted to shapefile format after adding data using writeOGR. The new file NY8_bna_utm18.gpkg has been constructed from the original BNA file, but read using the OGR BNA driver with GEOS support. The NY8 shapefile includes invalid polygons, but because the OGR BNA driver may have GEOS support (used here), the tract polygon objects are valid.

Source

http://www.sph.emory.edu/~lwaller/ch9index.htm

References

Waller, L. and C. Gotway (2004) Applied Spatial Statistics for Public Health Data. New York: John Wiley and Sons.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## NY leukemia
## Not run: 
library(foreign)
nydata <- read.dbf(system.file("misc/nydata.dbf", package="spData")[1])
library(sp)
coordinates(nydata) <- c("X", "Y")
plot(nydata)

nyadjmat <- as.matrix(read.dbf(system.file("misc/nyadjwts.dbf",
                                           package="spData")[1])[-1])
ID <- as.character(names(read.dbf(system.file("misc/nyadjwts.dbf",
                                              package="spData")[1]))[-1])
identical(substring(ID, 2, 10), substring(as.character(nydata$AREAKEY), 2, 10))

library(spdep)
nyadjlw <- mat2listw(nyadjmat, as.character(nydata$AREAKEY))
listw_NY <- nb2listw(nyadjlw$neighbours, style="B")

## End(Not run)

Example output

To access larger datasets in this package, install the spDataLarge
package with: `install.packages('spDataLarge',
repos='https://nowosad.github.io/drat/', type='source')`
Field name:Z600701190changed to:Z600701190.1Field name:Z600701190changed to:Z600701190.2Field name:Z600701200changed to:Z600701200.1Field name:Z600701210changed to:Z600701210.1Field name:Z600701210changed to:Z600701210.2Field name:Z600701220changed to:Z600701220.1Field name:Z600701270changed to:Z600701270.1Field name:Z600701320changed to:Z600701320.1Field name:Z600701330changed to:Z600701330.1Field name:Z605303010changed to:Z605303010.1Field name:Z605303010changed to:Z605303010.2Field name:Z605303040changed to:Z605303040.1Field name:Z605303040changed to:Z605303040.2Field name:Z605303050changed to:Z605303050.1Field name:Z606700170changed to:Z606700170.1Field name:Z606700360changed to:Z606700360.1Field name:Z606700560changed to:Z606700560.1Field name:Z606700610changed to:Z606700610.1Field name:Z606700610changed to:Z606700610.2Field name:Z606701100changed to:Z606701100.1Field name:Z606701110changed to:Z606701110.1Field name:Z606701120changed to:Z606701120.1Field name:Z606701120changed to:Z606701120.2Field name:Z606701120changed to:Z606701120.3Field name:Z606701140changed to:Z606701140.1Field name:Z606701520changed to:Z606701520.1Field name:Z606701650changed to:Z606701650.1Field name:Z606701680changed to:Z606701680.1Field name:Z606701690changed to:Z606701690.1Field name:Z600701190changed to:Z600701190.1Field name:Z600701190changed to:Z600701190.2Field name:Z600701200changed to:Z600701200.1Field name:Z600701210changed to:Z600701210.1Field name:Z600701210changed to:Z600701210.2Field name:Z600701220changed to:Z600701220.1Field name:Z600701270changed to:Z600701270.1Field name:Z600701320changed to:Z600701320.1Field name:Z600701330changed to:Z600701330.1Field name:Z605303010changed to:Z605303010.1Field name:Z605303010changed to:Z605303010.2Field name:Z605303040changed to:Z605303040.1Field name:Z605303040changed to:Z605303040.2Field name:Z605303050changed to:Z605303050.1Field name:Z606700170changed to:Z606700170.1Field name:Z606700360changed to:Z606700360.1Field name:Z606700560changed to:Z606700560.1Field name:Z606700610changed to:Z606700610.1Field name:Z606700610changed to:Z606700610.2Field name:Z606701100changed to:Z606701100.1Field name:Z606701110changed to:Z606701110.1Field name:Z606701120changed to:Z606701120.1Field name:Z606701120changed to:Z606701120.2Field name:Z606701120changed to:Z606701120.3Field name:Z606701140changed to:Z606701140.1Field name:Z606701520changed to:Z606701520.1Field name:Z606701650changed to:Z606701650.1Field name:Z606701680changed to:Z606701680.1Field name:Z606701690changed to:Z606701690.1[1] TRUE
Loading required package: sf
Linking to GEOS 3.8.0, GDAL 3.0.4, PROJ 6.3.1

spData documentation built on Oct. 14, 2021, 5:06 p.m.