This repository contains the R code to fit with INLA the spatial and spatio-temporal models described in the work entitled "A two-stage approach to estimate spatial and spatio-temporal disease risks in the presence of local discontinuities and clusters" (Adin et al., 2019).
Two motivating applications are described in this work: stomach cancer mortality data in Spanish provinces during the year 2013, and brain cancer incidence data in 27 administrative regions of Navarre and the Basque Country during the period 2000-2008.
-
This .Rdata contains the following objects:
- Data:
data.frame
object with the number of observed and expected cases ('obs' and 'exp' variables, respectively) and standardized mortality ratio ('SMR') for each province ('prov') and time period ('year') for stomach cancer mortality data. - Carto.ESP:
sf
object with the cartography of the 47 continental Spanish provinces. - W: Spatial adjacency matrix of the Spanish provinces.
- Data:
-
This .Rdata contains the following objects:
- Data.INCI and Data.MORT:
data.frame
objects with the number of observed and expected cases ('obs' and 'exp' variables, respectively) and standardized incidence/mortality ratio ('SMR') for each administrative region ('region') and time period ('year') for brain cancer incidence and mortality data. - Carto.COM:
sf
object with the cartography of the 27 administrative regions of Navarre and the Basque Country. - W: Spatial adjacency matrix of the administrative regions.
- Data.INCI and Data.MORT:
R code to fit with INLA (http://www.r-inla.org/) the two-stage spatial and spatio-temporal models described in Adin et al. (2019). All the R files are written by the authors of the paper.
1. Main files
-
R code to fit two-stage spatial cluster models using Spanish stomach mortality data (stored in
StomachCancer_ESP.Rdata
file). It reproduces the results obtained in Section 5.1. of the present work. -
Example2_SpatioTemporal_CountData.R
R code to fit two-stage spatio-temporal cluster models using brain cancer incidence data in the regions of Navarre and Basque Country (stored in
BrainCancer_MUN.Rdata
file). It reproduces the results obtained in Section 5.2. of the present work.
2. Algorithms
-
Agglomerative hierarchical clustering algorithm for spatial data (Anderson et al., 2014).
-
Agglomerative hierarchical clustering algorithm for spatio-temporal data.
-
R code to fit the spatial models described in Equations (1) and (2) of the present work for each of the cluster configuration candidate.
-
TLmodel1a.R, TLmodel1b.R, TLmodel2a.R and TLmodel2b.R
R code to fit the spatio-temporal models with purely spatial cluster structures described in Section 3.1 of the present work for each cluster configuration candidate.
-
OptionI.R, OptionII.R, OptionIII.R and OptionIV.R
R code to fit the spatio-temporal models with space-time cluster structures described in Section 3.2 of the present work for each cluster configuration candidate.
3. Other auxiliary functions
-
It returns the Kronecker product of 2 matrices and the eigenvectors which span the null space of this product.
-
Function to create the neighbourhood matrix of areas within each cluster.
*2021/01/11: Slight modifications have been introduced in order to be compatible with the 20.12.10 testing version of INLA. More precisely, we eliminate the redundant constraints in the extraconstr
argument of the INLA::inla()
function.
This work has been supported by the Spanish Ministry of Economy and Competitiveness (project MTM2014-51992-R), by the Spanish Ministry of Economy, Industry, and Competitiveness (project MTM2017-82553-R, AEI/FEDER, UE), and by the UK Medical Research Council (Grant number MR/L022184/1).