Replication codes for
Suspected heroin-related overdose incidents in Cincinnati, Ohio: a spatiotemporal analysis by Zehang Richard Li, Evaline Xie, Forrest W. Crawford, Joshua L. Warren, Kathryn McConnell, J. Tyler Copple, Tyler Johnson, Gregg S. Gonsalves
To replicate the main analysis, set working directory to the codes/
folder and run the following command in R.
source('baseModel.R')
The workingspace is saved in the fitted-model
folder, and a collection of figures in figures
folder. Some maps are produced with multiple color schemes. Running the whole script takes less than 20 minutes on a 6-core Macbook Pro.
countPoint.R
: function for preprocessing geo-codede datareadCin-bg.R
: Read the data files and calculate covariates at the Block Group level.readCin-sna.R
: Read the data files and calculate covariates at the Neighborhood level.
formulalist.R
: set up the formulas for model specification.baseModel.R
: Model fitting.vis-data.R
: Visualization of the data.vis-fit.R
: Visualization of the fitted model.
filterEMS.R
: process the raw spreadsheets from Cincinnati open data website and save smaller copies in the data repository.get_park_bus.R
: process park and bus stop shapefiles.get_zoning.R
: process zoning datagetBlockGEO.R
: process block group shapefiles and link to neighborhoods.
These scripts will take a long time to run since they fit multiple models.
sensitivity-EMS.R
: sensitivity analysis comparing different EMS call inclusions.sensitivity-blockgroup.R
: sensitivity analysis comparing different block group definitions.compareModel.R
: sensitivity analysis comparing different models.