This repository contains the data and the codes necessary to reproduce the figures in the paper Raking mortality rates across cause, population group and geography with uncertainty quantification, available on arXiv.
You should first install the raking package through the GitHub repository:
- First clone this repository:
git clone "https://github.com/ADucellierIHME/Raking_paper.git"
- Go to the new raking paper directory:
cd Raking_paper
- Create a new conda environment using the existing yml file:
conda env create -f environment.yml
- Activate the new environment:
conda activate env_raking
- Upgrade pip:
pip install --upgrade pip
Go back to the parent directory and clone the raking package repository:
cd ..
git clone "https://github.com/ihmeuw-msca/raking"
- Go to the new raking directory:
cd raking
- Install the raking package:
pip install -e .
You can now use the Python scripts in this repository to reproduce the figures.
The notebook methods/simulation_choice_weights.ipynb is used to make the figure in the Supplement 3, Section 1.
The script methods/distances_figure.py is used to make the figure in the Supplement 3, Section 2.
The script methods/missing_data_figure.py is used to make the figure in the Supplement 3, Section 3.
The notebook synthetics/synthetic_example.ipynb is used to make the figures in the Section 2.
The Python scripts in the application directory are used to run the raking on the data and make the figures in the Section 4.
Although the raking package is written in Python, it is possible to use it with R, a Python conda environment with the raking package installed, and the R library reticulate. In the Rcode directory, you will find examples of R code to run the same scripts and check that we obtain the same results.