DOI: 10.5281/zenodo.1489359
title: Code + simulated + publically accessable data for "Evaluating health facility access using Bayesian spatial models and location analysis methods"

description: # README

These files contain r data objects and R files that represent the key details of the paper, "Evaluating health facility access using Bayesian spatial models and location analysis methods".

The following datasources are available for simulation of some of the ideas in the paper.

- dat_grid_sim: simulated data of the grid and grid cells<br>
- dat_ohca_cv_sim: simulated data containing the cross validated test/training sets of OHCA data<br>
- dat_ohca_sim: simulated OHCA event data<br>
- dat_aed_sim: simulated AED location data<br>
- dat_bldg_sim: simulated building location data<br>
- dat_municipality_sim: simulated municipality information<br>
- table_1: Table 1 information containing key demographic data

These data were produced using the code in 01-create-sim-data.R, and one of the statistical models is demonstrated in 02-demo-inla-model.R

In terms of the paper itself, the functions and code used in the manuscript are located in:

* 01_tidy.Rmd - analysis code used to tidy up the data

* 02_fit_fixed_all_cv.Rmd - analysis code used to place AEDs

* 02_model.Rmd - analysis code used to fit the model in INLA

* 03_manuscript.Rmd - Full code and text used to create the paper

* 04_supp_materials.Rmd - full code and text used to create the supplementary materials

The following files are a part of an R package "swatial" that was developed along with the paper. These files are:

* DESCRIPTION

* NAMESPACE

* LICENSE

* LICENSE.md

* decay.R

* spherical-distance.R

* test-figure-data-matches.R

* test-table-data-matches.R

* testthat.R

* tidy-inla.R

* tidy-posterior-coefs.R

* tidy-predictions.R

* utils-pipe.R

* All files that end in .Rd are documentation files for the functions.

## Regarding data sources

Census information for Ticino was transcribed from the Annual Statistical Report of Canton Ticino from years 2010 to 2015. This data was taken from their publicly accessible annual reports - for example: (https://www3.ti.ch/DFE/DR/USTAT/allegati/volume/ast_2015.pdf). The raw data was extracted from these annual reports, and placed into the file: "swiss_census_popn_2010_2015.xlsx". These data are put into analysis ready format in the file “01_tidy.Rmd”

Housing and other relevant geospatial data can be accessed via http://map.housing-stat.ch/ and https://data.geo.admin.ch/. The maps of buildings from the REA (Register of Buildings and Dwellings) can be found here: https://map.geo.admin.ch/?zoom=11&bgLayer=ch.swisstopo.pixelkarte-grau&lang=en&topic=ech&layers=ch.bfs.gebaeude_wohnungs_register,ch.swisstopo.swissboundaries3d-gemeinde-flaeche.fill,ch.bfs.volkszaehlung-gebaeudestatistik_gebaeude,ch.bfs.volkszaehlung-gebaeudestatistik_wohnungen,ch.swisstopo.swissbuildings3d_1.metadata,ch.swisstopo.swissbuildings3d_2.metadata&E=2717616.28&N=1096597.25&catalogNodes=687,696&layers_timestamp=,,2016,2016,,&layers_visibility=true,false,false,false,false,false&layers_opacity=1,1,1,1,1,0.75

For further enquiries on this data, contact the Swiss federal Office of Statistics at the details listed here: https://www.bfs.admin.ch/bfs/en/home/services/contact.html

The shapefiles of the Comuni can be accessed here: https://www4.ti.ch/dfe/de/ucr/documentazione/download-file/?noMobile=1

Data from the people living in the Municipalities in Ticino can be downloaded here: https://www3.ti.ch/DFE/DR/USTAT/index.php?fuseaction=dati.home&tema=33&id2=61&id3=65&c1=01&c2=02&c3=02

## Future work

In the future, these functions from the paper may be generalised and put into their own package. If that happens, this repository will be updated with a link to updated functions.