Authors: Andreu Comas-García & Arturo Erdely
Preprint: arXiv
- Download and install the Julia programming language.
- Download and unzip the data from the following Google Drive link in a working directory of your election.
- Open the
Julia
terminal and change to the working directory where you unzipped the files. You may do this by defining a string variablepath
with the path to the files directory and then execute in the terminalcd(path)
. For example, in the operating system Windows it may look something like:path = "D:/MyFiles/rawdata2022mx" cd(path) readdir()
- Download the code files clicking in the green button
<> Code
of this GitHub repository andDownloadZIP
. Unzip the downloaded file and move the following files into the same working directory as the downloaded data in the previous step:0auxfunctions.jl
,1packages.jl
,2deaths.jl
,3population.jl
,4figures.jl
,5tables.jl
, and6other.jl
- Install the required packages by executing the following command in the
Julia
terminal. This may take a while:include("1packages.jl")
- Process deaths data. This will take several hours (4 approx) and will generate several new
.csv
data files:include("2deaths.jl")
- Process population data. This is quite fast and will generate several new
.csv
data files:include("3population.jl")
- Create 4 figures as
.png
image files:include("4figures.jl")
Figure1.png
: % of non-illnes deaths & observed illness-related deaths 1998-2019Figure2.png
: illness-related excess mortality 2020 | 2021 | 2022Figure3.png
: % illness-related excess of mortality 2020-2022 males vs femalesFigure4.png
: illness-related excess mortality 2020-2022 by sex and age groups
- Create 6 tables in
.csv
file format:include("5tables.jl")
Table1.csv
: Excess mortality in Mexico 2020Table2.csv
: Excess mortality in Mexico 2021Table3.csv
: Excess mortality in Mexico 2022Table4.csv
: Excess mortality in Mexico 2020-2022Table5.csv
: Excess mortality in Mexico 2020-2022 (males)Table6.csv
: Excess mortality in Mexico 2020-2022 (females)
- Generate supplementary figures and calculations:
include("6other.jl")
FigureExtra1.png
: illness-related deaths evolution of fitted parametersFigureExtra2.png
: adjusted R-squared and Anderson-Darling test for normality of residualsFigureExtra3.png
: some examples of the fitted model