Decomposition of the US black/white inequality in premature mortality, , 2010–2015: an observational study
Code for our BMJ Open paper “Decomposition of the US black/white inequality in premature mortality, 2010–2015: an observational study”. This paper uses joint Bayesian spatial models with restricted-access compressed mortality data to estimate and decompose black/white inequalities in premature mortality. The full citation is:
Kiang MV, Krieger N, Buckee CO, Onnela JP, & Chen JT, Decomposition of the US black/white inequality in premature mortality, 2010–2015: an observational study, BMJ Open (December 2019), doi: 10.1136/bmjopen-2019-029373
Please submit issues via Github or via email.
Important note about reproducibility
Due to limitations on sharing the restricted-access data, this pipeline
is not fully reproducible. To reproduce the pipeline, you must have the
restricted-access compressed mortality files and the accompanying
population estimates. Specify the path to these files in the
04_extracting_cmf_data.R script in lines 64 and 72.
Since completion of this project, there have been significant advances
in the underlying software packages. For example,
stan now allows for
parallel processing within a single
should substantially reduce computation time. In addition, there has
been significant development in estimating a spatial conditional
cor_car() in the
package). Members of the
stan team themselves have published an
example that did not exist
when this project was underway.
All that to say, this code should be considered a starting point for future project development. Modernizing the code used in this project will likely decrease the computational burden substantially.
Restricted-access compressed mortality files
Request access to the compressed mortality files through the National Center for Health Statistics.
All analyses are conducted using
The code is made to be run in sequential order.
Intermediate, publicly-available files (e.g., the ACS variables and
shapefiles) are included, so you should not need to update
However, if you want to use other ACS variables, or start from scratch,
you will need to request an API key from
the US Census Bureau and put it in the
config.yml file. See
./config.yml for descriptions of project-wide parameters that can be
Code files beginning with
50_ were used internally for diagnostic
purposes but not included in the final manuscript.