readme.txt Last updated on February 1, 2022 This document summarizes data and scripts used to generate the tables and figures in the manuscript, titled: "To what extent were life expectancy gains in South Africa attributable to declines in HIV/AIDS mortality from 2006 to 2017? A life table analysis of age-specific mortality including child mortality" The scripts were created with Python version 3.7.3, and tested with versions 3.7.3 and 3.7.6. In our most recent analysis, we used MacBook Pro with macOS Big Sur. 1. "RAW_DATA" folder contains raw data files, collected from Thembisa version 4.2, from 2000 to 2017. The files contain the number of deaths (all-cause death, non-HIV/AIDS death) and population for each 1-year age group. 2. "SCRIPT" folder contains python scripts to process the files in the RAW_DATA folder, and stores results in the "RESULT" folder. - constants.py contains constants used in other scripts. - rev_process_thembisa.py contains methods to process raw data files to generate age-specific mortality rates - rev_calculate_le.py contains methods to calculate life expectancy - main.py uses all of the scripts above to create the tables and save the files. 3. "RESULT" folder contains life expectancy estimates for each sex (men, women, both) under three cases: actual, best-case, and worst-case. 4. "worksheet_tables.xlsx" demonstrates calculations used to create the tables in the manuscript (rounded to the first decimal place). It is also provided in .csv format ("worksheet_tables1.csv" and "worksheet_tables2.csv"). You only need to run main.py in the SCRIPT folder. It can be run on terminal or on IDEs such as Spyder. Before running, please set the working directory as the locations of the scripts. On terminal, the command "python main.py" will create the files in the RESULT folder.