-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
27dbaa9
commit 1166cbc
Showing
4 changed files
with
179 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
\begin{table} | ||
\centering | ||
\caption{Age-specific parameters for wild-type COVID-19} | ||
\label{agespec_table} | ||
\begin{tabular}{p{2cm} p{3cm} p{3cm} p{3cm} p{3cm}} | ||
\toprule | ||
Age group & Rel. suscepitbility to infection (ref. 15-69 y.o.)\cite{zhang-2020-a} & Proportion symptomatic\cite{sah-2021} & Proportion of symptomatic patients hospitalised [CURRENTLY USING Dutch GGD report from 4th August 2020, Table 3] & Infection fatality rate\cite{odriscoll-2021} \\ | ||
\midrule | ||
0-4 & 0.36 & 0.533 & 0.0777 & 0.00003 \\ | ||
5-9 & 0.36 & 0.533 & 0.0069 & 0.00001 \\ | ||
10-14 & 0.36 & 0.533 & 0.0034 & 0.00001 \\ | ||
15-19 & 1.00 & 0.533 & 0.0051 & 0.00003 \\ | ||
20-24 & 1.00 & 0.679 & 0.0068 & 0.00006 \\ | ||
25-29 & 1.00 & 0.679 & 0.0080 & 0.00013 \\ | ||
30-34 & 1.00 & 0.679 & 0.0124 & 0.00024 \\ | ||
35-39 & 1.00 & 0.679 & 0.0129 & 0.00040 \\ | ||
40-44 & 1.00 & 0.679 & 0.0190 & 0.00075 \\ | ||
45-49 & 1.00 & 0.679 & 0.0331 & 0.00121 \\ | ||
50-54 & 1.00 & 0.679 & 0.0383 & 0.00207 \\ | ||
55-59 & 1.00 & 0.679 & 0.0579 & 0.00323 \\ | ||
60-64 & 1.00 & 0.803 & 0.0617 & 0.00456 \\ | ||
65-69 & 1.00 & 0.803 & 0.1030 & 0.01075 \\ | ||
70-74 & 1.41 & 0.803 & 0.1072 & 0.01674 \\ | ||
75-79 & 1.41 & 0.803 & 0.0703 & 0.03203 \\ | ||
80 and above & 1.41 & 0.803 & 0.0703 & 0.08292 \\ | ||
\bottomrule | ||
\end{tabular} | ||
\end{table} |
Binary file not shown.
148 changes: 148 additions & 0 deletions
148
notebooks/user/rragonnet/project_specific/School_Closure/agespec_param_table.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from autumn.projects.sm_covid2.common_school.project_maker import get_school_project_parameter_set\n", | ||
"import pandas as pd\n", | ||
"from copy import copy\n", | ||
"from pathlib import Path" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"model_params = get_school_project_parameter_set(\n", | ||
" iso3 = \"FRA\",\n", | ||
" first_date_with_death = 0,\n", | ||
" sero_age_min = 0,\n", | ||
" sero_age_max = 100,\n", | ||
" analysis='main'\n", | ||
").baseline\n", | ||
"age_params = model_params['age_stratification']" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"df = pd.DataFrame()\n", | ||
"df['ifr'] = pd.Series(age_params['ifr']['values'])\n", | ||
"df['susceptibility'] = pd.Series(age_params['susceptibility'])\n", | ||
"df['prop_symptomatic'] = pd.Series(age_params['prop_symptomatic'])\n", | ||
"df['prop_hospital'] = pd.Series(age_params['prop_hospital']['values'])" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# fill missing values for 80+ category\n", | ||
"for column in (\"susceptibility\", \"prop_symptomatic\", \"prop_hospital\"):\n", | ||
" df[column].loc[80] = df[column].loc[75]" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# new column for age group\n", | ||
"def get_agegroup_str(idx):\n", | ||
" if idx < 80:\n", | ||
" return f\"{idx}-{idx + 4}\"\n", | ||
" else:\n", | ||
" return \"80 and above\"\n", | ||
"\n", | ||
"df['agegroup'] = [get_agegroup_str(idx) for idx in df.index]" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"pd.set_option('display.max_colwidth', 2)\n", | ||
"tex_table = df.to_latex(\n", | ||
" columns=['agegroup', 'susceptibility', 'prop_symptomatic', 'prop_hospital', 'ifr'],\n", | ||
" header=['Age group', \"Rel. suscepitbility to infection (ref. 15-69 y.o.)\\cite{zhang-2020-a}\", \"Proportion symptomatic\\cite{sah-2021}\", \"Proportion of symptomatic patients hospitalised [CURRENTLY USING Dutch GGD report from 4th August 2020, Table 3]\", \"Infection fatality rate\\cite{odriscoll-2021}\"],\n", | ||
" index=False,\n", | ||
" label=\"agespec_table\",\n", | ||
" caption=\"Age-specific parameters for wild-type COVID-19\"\n", | ||
")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"tex_table = tex_table.replace(\"{lrrrr}\", \"{p{2cm} p{3cm} p{3cm} p{3cm} p{3cm}}\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Handle citations\n", | ||
"tex_table = tex_table.replace(\"\\\\textbackslash cite\\\\\", r\"\\cite\").replace(\"\\\\}\", \"}\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"out_path = Path.home() / \"Models\"/ \"AuTuMN_new\" / \"docs\" / \"tex\" / \"tex_descriptions\" / \"projects\" / \"sm_covid\" / \"agespec_table.tex\"" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"with out_path.open(\"w\") as f:\n", | ||
" f.write(tex_table)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "summer2", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.11" | ||
}, | ||
"orig_nbformat": 4 | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |