diff --git a/src/vivarium_gates_mncnh/components/hemoglobin.py b/src/vivarium_gates_mncnh/components/hemoglobin.py index 64264a9b..ccc53048 100644 --- a/src/vivarium_gates_mncnh/components/hemoglobin.py +++ b/src/vivarium_gates_mncnh/components/hemoglobin.py @@ -56,12 +56,12 @@ def build_all_lookup_tables(self, builder: Builder) -> None: value_columns=["value"], ) - def get_current_exposure(self, index: pd.Index) -> pd.Series: - propensity = self.propensity(index) - gbd_exposure = pd.Series(self.exposure_distribution.ppf(propensity), index=index) - return gbd_exposure - ( - self.ifa_effect_size * self.ifa_coverage * self.lookup_tables["ANC1"](index) - ) + # def get_current_exposure(self, index: pd.Index) -> pd.Series: + # propensity = self.propensity(index) + # gbd_exposure = pd.Series(self.exposure_distribution.ppf(propensity), index=index) + # return gbd_exposure - ( + # self.ifa_effect_size * self.ifa_coverage * self.lookup_tables["ANC1"](index) + # ) def on_time_step_cleanup(self, event: Event) -> None: if self._sim_step_name() != SIMULATION_EVENT_NAMES.FIRST_TRIMESTER_ANC: diff --git a/src/vivarium_gates_mncnh/components/observers.py b/src/vivarium_gates_mncnh/components/observers.py index fef56484..daeb9346 100644 --- a/src/vivarium_gates_mncnh/components/observers.py +++ b/src/vivarium_gates_mncnh/components/observers.py @@ -67,6 +67,7 @@ def register_stratifications(self, builder: Builder) -> None: PREGNANCY_OUTCOMES.STILLBIRTH_OUTCOME, PREGNANCY_OUTCOMES.LIVE_BIRTH_OUTCOME, PREGNANCY_OUTCOMES.PARTIAL_TERM_OUTCOME, + PREGNANCY_OUTCOMES.FULL_TERM_OUTCOME, ] ), requires_columns=[COLUMNS.PREGNANCY_OUTCOME], @@ -534,7 +535,7 @@ def configuration_defaults(self) -> dict[str, Any]: "stratification": { self.get_configuration_name(): { "exclude": [], - "include": ["age_group"], + "include": ["age_group", "pregnancy_outcome"], }, }, } diff --git a/src/vivarium_gates_mncnh/constants/paths.py b/src/vivarium_gates_mncnh/constants/paths.py index e3db8e55..36b4f419 100644 --- a/src/vivarium_gates_mncnh/constants/paths.py +++ b/src/vivarium_gates_mncnh/constants/paths.py @@ -31,5 +31,5 @@ # Update for new model results directory after model changes and runs # This should match the directory after /mnt/team/simulation_sicence/pub/models/vivarium_gates_mncnh/results/ -MODEL_RESULTS_DIR = "model26.0" +MODEL_RESULTS_DIR = "model29.2" MODEL_NOTEBOOKS_DIR = BASE_DIR.parent.parent / "tests" / "model_notebooks" diff --git a/src/vivarium_gates_mncnh/model_specifications/model_spec.yaml b/src/vivarium_gates_mncnh/model_specifications/model_spec.yaml index fd121052..24a46d68 100755 --- a/src/vivarium_gates_mncnh/model_specifications/model_spec.yaml +++ b/src/vivarium_gates_mncnh/model_specifications/model_spec.yaml @@ -37,7 +37,7 @@ components: - InterventionRiskEffect('azithromycin') - InterventionRiskEffect('misoprostol') - OralIronInterventionExposure() # IFA and MMS - - OralIronEffectOnHemoglobin() + # - OralIronEffectOnHemoglobin() - OralIronEffectOnStillbirth() - AdditiveRiskEffect('risk_factor.iron_folic_acid_supplementation', 'risk_factor.birth_weight.birth_exposure') - AdditiveRiskEffect('risk_factor.multiple_micronutrient_supplementation', 'risk_factor.birth_weight.birth_exposure') diff --git a/tests/model_notebooks/results/model_26.0_anemic_screening.ipynb b/tests/model_notebooks/results/model_26.0_anemic_screening.ipynb index 6fa812de..6488b647 100644 --- a/tests/model_notebooks/results/model_26.0_anemic_screening.ipynb +++ b/tests/model_notebooks/results/model_26.0_anemic_screening.ipynb @@ -1,9 +1,30 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "ca85564d", + "metadata": { + "tags": [ + "papermill-error-cell-tag" + ] + }, + "source": [ + "An Exception was encountered at 'In [22]'." + ] + }, { "cell_type": "markdown", "id": "42c4fb6b", - "metadata": {}, + "metadata": { + "papermill": { + "duration": 0.033839, + "end_time": "2026-02-19T18:44:43.535991", + "exception": false, + "start_time": "2026-02-19T18:44:43.502152", + "status": "completed" + }, + "tags": [] + }, "source": [ "# V&V anemia screening and iron interventions (after sim run)\n", "\n", @@ -17,7 +38,16 @@ { "cell_type": "markdown", "id": "ba9b8f9d", - "metadata": {}, + "metadata": { + "papermill": { + "duration": 0.030072, + "end_time": "2026-02-19T18:44:43.598381", + "exception": false, + "start_time": "2026-02-19T18:44:43.568309", + "status": "completed" + }, + "tags": [] + }, "source": [ "## Setup" ] @@ -26,7 +56,22 @@ "cell_type": "code", "execution_count": 1, "id": "17844057", - "metadata": {}, + "metadata": { + "execution": { + "iopub.execute_input": "2026-02-19T18:44:43.647772Z", + "iopub.status.busy": "2026-02-19T18:44:43.647495Z", + "iopub.status.idle": "2026-02-19T18:44:48.488840Z", + "shell.execute_reply": "2026-02-19T18:44:48.487017Z" + }, + "papermill": { + "duration": 4.86269, + "end_time": "2026-02-19T18:44:48.491067", + "exception": false, + "start_time": "2026-02-19T18:44:43.628377", + "status": "completed" + }, + "tags": [] + }, "outputs": [], "source": [ "import pandas as pd, numpy as np, os\n", @@ -42,7 +87,22 @@ "cell_type": "code", "execution_count": 2, "id": "c5616ea4", - "metadata": {}, + "metadata": { + "execution": { + "iopub.execute_input": "2026-02-19T18:44:48.537626Z", + "iopub.status.busy": "2026-02-19T18:44:48.536587Z", + "iopub.status.idle": "2026-02-19T18:44:48.543575Z", + "shell.execute_reply": "2026-02-19T18:44:48.541973Z" + }, + "papermill": { + "duration": 0.031199, + "end_time": "2026-02-19T18:44:48.545082", + "exception": false, + "start_time": "2026-02-19T18:44:48.513883", + "status": "completed" + }, + "tags": [] + }, "outputs": [], "source": [ "import warnings\n", @@ -53,7 +113,22 @@ "cell_type": "code", "execution_count": 3, "id": "8999e768", - "metadata": {}, + "metadata": { + "execution": { + "iopub.execute_input": "2026-02-19T18:44:48.592111Z", + "iopub.status.busy": "2026-02-19T18:44:48.591333Z", + "iopub.status.idle": "2026-02-19T18:44:48.597958Z", + "shell.execute_reply": "2026-02-19T18:44:48.596194Z" + }, + "papermill": { + "duration": 0.031693, + "end_time": "2026-02-19T18:44:48.599267", + "exception": false, + "start_time": "2026-02-19T18:44:48.567574", + "status": "completed" + }, + "tags": [] + }, "outputs": [], "source": [ "locations = ['Pakistan', 'Ethiopia', 'Nigeria']" @@ -61,9 +136,22 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "id": "c884ca39", "metadata": { + "execution": { + "iopub.execute_input": "2026-02-19T18:44:48.647977Z", + "iopub.status.busy": "2026-02-19T18:44:48.647441Z", + "iopub.status.idle": "2026-02-19T18:44:48.653432Z", + "shell.execute_reply": "2026-02-19T18:44:48.651764Z" + }, + "papermill": { + "duration": 0.031224, + "end_time": "2026-02-19T18:44:48.654939", + "exception": false, + "start_time": "2026-02-19T18:44:48.623715", + "status": "completed" + }, "tags": [ "parameters" ] @@ -74,19 +162,71 @@ "model_dir = \"model26.0\"" ] }, + { + "cell_type": "code", + "execution_count": 5, + "id": "60f77a7a", + "metadata": { + "execution": { + "iopub.execute_input": "2026-02-19T18:44:48.697825Z", + "iopub.status.busy": "2026-02-19T18:44:48.697327Z", + "iopub.status.idle": "2026-02-19T18:44:48.702960Z", + "shell.execute_reply": "2026-02-19T18:44:48.701403Z" + }, + "papermill": { + "duration": 0.025479, + "end_time": "2026-02-19T18:44:48.704096", + "exception": false, + "start_time": "2026-02-19T18:44:48.678617", + "status": "completed" + }, + "tags": [ + "injected-parameters" + ] + }, + "outputs": [], + "source": [ + "# Parameters\n", + "model_dir = \"model29.1\"\n" + ] + }, { "cell_type": "code", "execution_count": null, "id": "d61189b7", - "metadata": {}, + "metadata": { + "papermill": { + "duration": 0.01614, + "end_time": "2026-02-19T18:44:48.739572", + "exception": false, + "start_time": "2026-02-19T18:44:48.723432", + "status": "completed" + }, + "tags": [] + }, "outputs": [], "source": [] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "id": "39edbf55", - "metadata": {}, + "metadata": { + "execution": { + "iopub.execute_input": "2026-02-19T18:44:48.774458Z", + "iopub.status.busy": "2026-02-19T18:44:48.773959Z", + "iopub.status.idle": "2026-02-19T18:44:48.780130Z", + "shell.execute_reply": "2026-02-19T18:44:48.778609Z" + }, + "papermill": { + "duration": 0.024892, + "end_time": "2026-02-19T18:44:48.781199", + "exception": false, + "start_time": "2026-02-19T18:44:48.756307", + "status": "completed" + }, + "tags": [] + }, "outputs": [], "source": [ "base_results_dir = Path(\"/mnt/team/simulation_science/pub/models/vivarium_gates_mncnh/results/\") / model_dir" @@ -94,19 +234,41 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "id": "ce00515d", - "metadata": {}, + "metadata": { + "execution": { + "iopub.execute_input": "2026-02-19T18:44:48.818626Z", + "iopub.status.busy": "2026-02-19T18:44:48.818137Z", + "iopub.status.idle": "2026-02-19T18:44:48.839007Z", + "shell.execute_reply": "2026-02-19T18:44:48.837784Z" + }, + "papermill": { + "duration": 0.040805, + "end_time": "2026-02-19T18:44:48.840175", + "exception": false, + "start_time": "2026-02-19T18:44:48.799370", + "status": "completed" + }, + "tags": [] + }, "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Multiple timestamps: [PosixPath('/mnt/team/simulation_science/pub/models/vivarium_gates_mncnh/results/model29.1/ethiopia/2026_02_17_09_48_51'), PosixPath('/mnt/team/simulation_science/pub/models/vivarium_gates_mncnh/results/model29.1/ethiopia/2026_02_17_13_50_47')], using /mnt/team/simulation_science/pub/models/vivarium_gates_mncnh/results/model29.1/ethiopia/2026_02_17_13_50_47\n" + ] + }, { "data": { "text/plain": [ - "{'Pakistan': PosixPath('/mnt/team/simulation_science/pub/models/vivarium_gates_mncnh/results/model26.0/pakistan/2025_12_17_10_49_59/results'),\n", - " 'Ethiopia': PosixPath('/mnt/team/simulation_science/pub/models/vivarium_gates_mncnh/results/model26.0/ethiopia/2025_12_17_10_40_11/results'),\n", - " 'Nigeria': PosixPath('/mnt/team/simulation_science/pub/models/vivarium_gates_mncnh/results/model26.0/nigeria/2025_12_17_10_43_58/results')}" + "{'Pakistan': PosixPath('/mnt/team/simulation_science/pub/models/vivarium_gates_mncnh/results/model29.1/pakistan/2026_02_17_13_51_55/results'),\n", + " 'Ethiopia': PosixPath('/mnt/team/simulation_science/pub/models/vivarium_gates_mncnh/results/model29.1/ethiopia/2026_02_17_13_50_47/results'),\n", + " 'Nigeria': PosixPath('/mnt/team/simulation_science/pub/models/vivarium_gates_mncnh/results/model29.1/nigeria/2026_02_17_13_52_38/results')}" ] }, - "execution_count": 4, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -127,9 +289,24 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 8, "id": "56595a21", - "metadata": {}, + "metadata": { + "execution": { + "iopub.execute_input": "2026-02-19T18:44:48.880192Z", + "iopub.status.busy": "2026-02-19T18:44:48.879676Z", + "iopub.status.idle": "2026-02-19T18:44:49.989307Z", + "shell.execute_reply": "2026-02-19T18:44:49.988303Z" + }, + "papermill": { + "duration": 1.13157, + "end_time": "2026-02-19T18:44:49.991825", + "exception": false, + "start_time": "2026-02-19T18:44:48.860255", + "status": "completed" + }, + "tags": [] + }, "outputs": [ { "data": { @@ -191,7 +368,7 @@ "183 214 Nigeria admin0 admin0" ] }, - "execution_count": 5, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -204,9 +381,24 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 9, "id": "c68e32ef", - "metadata": {}, + "metadata": { + "execution": { + "iopub.execute_input": "2026-02-19T18:44:50.053415Z", + "iopub.status.busy": "2026-02-19T18:44:50.052871Z", + "iopub.status.idle": "2026-02-19T18:44:50.059318Z", + "shell.execute_reply": "2026-02-19T18:44:50.057664Z" + }, + "papermill": { + "duration": 0.037767, + "end_time": "2026-02-19T18:44:50.060628", + "exception": false, + "start_time": "2026-02-19T18:44:50.022861", + "status": "completed" + }, + "tags": [] + }, "outputs": [], "source": [ "def load_yaml_file(path):\n", @@ -216,19 +408,34 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 10, "id": "8a6d8091", - "metadata": {}, + "metadata": { + "execution": { + "iopub.execute_input": "2026-02-19T18:44:50.118886Z", + "iopub.status.busy": "2026-02-19T18:44:50.118540Z", + "iopub.status.idle": "2026-02-19T18:44:50.183571Z", + "shell.execute_reply": "2026-02-19T18:44:50.181310Z" + }, + "papermill": { + "duration": 0.094588, + "end_time": "2026-02-19T18:44:50.185460", + "exception": false, + "start_time": "2026-02-19T18:44:50.090872", + "status": "completed" + }, + "tags": [] + }, "outputs": [ { "data": { "text/plain": [ - "{'Pakistan': '/mnt/team/simulation_science/pub/models/vivarium_gates_mncnh/artifacts/model24.2/pakistan.hdf',\n", - " 'Ethiopia': '/mnt/team/simulation_science/pub/models/vivarium_gates_mncnh/artifacts/model24.2/ethiopia.hdf',\n", - " 'Nigeria': '/mnt/team/simulation_science/pub/models/vivarium_gates_mncnh/artifacts/model24.2/nigeria.hdf'}" + "{'Pakistan': '/mnt/team/simulation_science/pub/models/vivarium_gates_mncnh/artifacts/model24.4/pakistan.hdf',\n", + " 'Ethiopia': '/mnt/team/simulation_science/pub/models/vivarium_gates_mncnh/artifacts/model24.4/ethiopia.hdf',\n", + " 'Nigeria': '/mnt/team/simulation_science/pub/models/vivarium_gates_mncnh/artifacts/model24.4/nigeria.hdf'}" ] }, - "execution_count": 7, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -244,19 +451,38 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 11, "id": "58ffaea5", - "metadata": {}, + "metadata": { + "execution": { + "iopub.execute_input": "2026-02-19T18:44:50.235350Z", + "iopub.status.busy": "2026-02-19T18:44:50.234902Z", + "iopub.status.idle": "2026-02-19T18:44:50.245963Z", + "shell.execute_reply": "2026-02-19T18:44:50.244449Z" + }, + "papermill": { + "duration": 0.035464, + "end_time": "2026-02-19T18:44:50.247225", + "exception": false, + "start_time": "2026-02-19T18:44:50.211761", + "status": "completed" + }, + "tags": [] + }, "outputs": [], "source": [ - "def read_results(result_file_name, baseline_only=True):\n", + "def read_results(observation_dir, baseline_only=True):\n", " all_locations_results = []\n", " for location, result_dir in results_dirs.items():\n", - " if baseline_only:\n", - " filters = [('scenario', '==', 'baseline')]\n", - " location_results = pd.read_parquet(result_dir / f'{result_file_name}.parquet', filters=filters)\n", - " else:\n", - " location_results = pd.read_parquet(result_dir / f'{result_file_name}.parquet')\n", + " location_results = pd.DataFrame()\n", + " for file_path in Path(result_dir / observation_dir).glob('*'):\n", + " if baseline_only:\n", + " filters = [('scenario', '==', 'baseline')]\n", + " observation_results = pd.read_parquet(file_path, filters=filters)\n", + " else:\n", + " observation_results = pd.read_parquet(file_path)\n", + " location_results = pd.concat([location_results, observation_results])\n", + " \n", " location_results['location'] = location\n", "\n", " if baseline_only:\n", @@ -274,9 +500,24 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 12, "id": "f0ad3e4c-ffb2-49c8-a418-f6e3b669ab14", - "metadata": {}, + "metadata": { + "execution": { + "iopub.execute_input": "2026-02-19T18:44:50.287735Z", + "iopub.status.busy": "2026-02-19T18:44:50.287196Z", + "iopub.status.idle": "2026-02-19T18:45:38.407421Z", + "shell.execute_reply": "2026-02-19T18:45:38.405585Z" + }, + "papermill": { + "duration": 48.180004, + "end_time": "2026-02-19T18:45:38.446720", + "exception": false, + "start_time": "2026-02-19T18:44:50.266716", + "status": "completed" + }, + "tags": [] + }, "outputs": [ { "data": { @@ -322,7 +563,7 @@ " adequate\n", " covered\n", " ifa\n", - " live_birth\n", + " full_term\n", " False\n", " adequate\n", " adequate\n", @@ -338,7 +579,7 @@ " adequate\n", " covered\n", " ifa\n", - " live_birth\n", + " full_term\n", " False\n", " adequate\n", " adequate\n", @@ -354,7 +595,7 @@ " adequate\n", " covered\n", " ifa\n", - " live_birth\n", + " full_term\n", " False\n", " adequate\n", " adequate\n", @@ -370,7 +611,7 @@ " adequate\n", " covered\n", " ifa\n", - " live_birth\n", + " full_term\n", " False\n", " adequate\n", " adequate\n", @@ -386,7 +627,7 @@ " adequate\n", " covered\n", " ifa\n", - " live_birth\n", + " full_term\n", " False\n", " adequate\n", " adequate\n", @@ -408,11 +649,11 @@ "4 10_to_14 first_trimester_and_later_pregnancy adequate \n", "\n", " iv_iron_coverage oral_iron_coverage pregnancy_outcome preterm_birth \\\n", - "0 covered ifa live_birth False \n", - "1 covered ifa live_birth False \n", - "2 covered ifa live_birth False \n", - "3 covered ifa live_birth False \n", - "4 covered ifa live_birth False \n", + "0 covered ifa full_term False \n", + "1 covered ifa full_term False \n", + "2 covered ifa full_term False \n", + "3 covered ifa full_term False \n", + "4 covered ifa full_term False \n", "\n", " tested_hemoglobin_exposure true_hemoglobin_exposure \\\n", "0 adequate adequate \n", @@ -429,7 +670,7 @@ "4 anemia_screening_and_iv_iron_scaleup 115 Pakistan 0.0 " ] }, - "execution_count": 9, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } @@ -442,17 +683,32 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 13, "id": "38f02f75", - "metadata": {}, + "metadata": { + "execution": { + "iopub.execute_input": "2026-02-19T18:45:38.527060Z", + "iopub.status.busy": "2026-02-19T18:45:38.526441Z", + "iopub.status.idle": "2026-02-19T18:45:38.942340Z", + "shell.execute_reply": "2026-02-19T18:45:38.941237Z" + }, + "papermill": { + "duration": 0.458055, + "end_time": "2026-02-19T18:45:38.944151", + "exception": false, + "start_time": "2026-02-19T18:45:38.486096", + "status": "completed" + }, + "tags": [] + }, "outputs": [ { "data": { "text/plain": [ - "['anemia_screening_and_iv_iron_scaleup', 'baseline']" + "['anemia_screening_and_iv_iron_scaleup', 'baseline', 'mms_total_scaleup']" ] }, - "execution_count": 10, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } @@ -466,7 +722,16 @@ { "cell_type": "markdown", "id": "d89d4d65", - "metadata": {}, + "metadata": { + "papermill": { + "duration": 0.023372, + "end_time": "2026-02-19T18:45:38.990689", + "exception": false, + "start_time": "2026-02-19T18:45:38.967317", + "status": "completed" + }, + "tags": [] + }, "source": [ "## checks on anemia screening" ] @@ -474,7 +739,16 @@ { "cell_type": "markdown", "id": "7db4746a", - "metadata": {}, + "metadata": { + "papermill": { + "duration": 0.021462, + "end_time": "2026-02-19T18:45:39.035381", + "exception": false, + "start_time": "2026-02-19T18:45:39.013919", + "status": "completed" + }, + "tags": [] + }, "source": [ "### hemoglobin" ] @@ -482,7 +756,16 @@ { "cell_type": "markdown", "id": "350faf46", - "metadata": {}, + "metadata": { + "papermill": { + "duration": 0.0213, + "end_time": "2026-02-19T18:45:39.078010", + "exception": false, + "start_time": "2026-02-19T18:45:39.056710", + "status": "completed" + }, + "tags": [] + }, "source": [ "CHECK: Hemoglobin screening/testing only occurs among those who attend later-pregnancy ANC.\n", "\n", @@ -491,9 +774,24 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 14, "id": "d73d9f96-92c9-4f4a-91d3-f07def393f0d", - "metadata": {}, + "metadata": { + "execution": { + "iopub.execute_input": "2026-02-19T18:45:39.128629Z", + "iopub.status.busy": "2026-02-19T18:45:39.128152Z", + "iopub.status.idle": "2026-02-19T18:45:39.553609Z", + "shell.execute_reply": "2026-02-19T18:45:39.552339Z" + }, + "papermill": { + "duration": 0.455142, + "end_time": "2026-02-19T18:45:39.554656", + "exception": false, + "start_time": "2026-02-19T18:45:39.099514", + "status": "completed" + }, + "tags": [] + }, "outputs": [], "source": [ "assert anc.loc[(anc.anc_coverage.isin(['none', 'first_trimester_only']))\n", @@ -502,9 +800,24 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 15, "id": "39c3e5ec", - "metadata": {}, + "metadata": { + "execution": { + "iopub.execute_input": "2026-02-19T18:45:39.613384Z", + "iopub.status.busy": "2026-02-19T18:45:39.612989Z", + "iopub.status.idle": "2026-02-19T18:45:48.387685Z", + "shell.execute_reply": "2026-02-19T18:45:48.386242Z" + }, + "papermill": { + "duration": 8.806728, + "end_time": "2026-02-19T18:45:48.388725", + "exception": false, + "start_time": "2026-02-19T18:45:39.581997", + "status": "completed" + }, + "tags": [] + }, "outputs": [ { "data": { @@ -516,7 +829,7 @@ "Name: mean, dtype: float64" ] }, - "execution_count": 12, + "execution_count": 15, "metadata": {}, "output_type": "execute_result" } @@ -537,36 +850,60 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 16, "id": "605f5bf3-4c73-43f3-bc11-59dc5f8f31fb", - "metadata": {}, + "metadata": { + "execution": { + "iopub.execute_input": "2026-02-19T18:45:48.426317Z", + "iopub.status.busy": "2026-02-19T18:45:48.426101Z", + "iopub.status.idle": "2026-02-19T18:45:49.501598Z", + "shell.execute_reply": "2026-02-19T18:45:49.499816Z" + }, + "papermill": { + "duration": 1.094923, + "end_time": "2026-02-19T18:45:49.502759", + "exception": false, + "start_time": "2026-02-19T18:45:48.407836", + "status": "completed" + }, + "tags": [] + }, "outputs": [ { "data": { "text/plain": [ "location scenario tested_hemoglobin_exposure\n", - "Ethiopia anemia_screening_and_iv_iron_scaleup adequate 0.689176\n", - " low 0.310824\n", + "Ethiopia anemia_screening_and_iv_iron_scaleup adequate 0.668752\n", + " low 0.331248\n", " not_tested 0.000000\n", - " baseline adequate 0.254391\n", - " low 0.114583\n", - " not_tested 0.631026\n", - "Nigeria anemia_screening_and_iv_iron_scaleup adequate 0.567940\n", - " low 0.432060\n", + " baseline adequate 0.420766\n", + " low 0.208967\n", + " not_tested 0.370267\n", + " mms_total_scaleup adequate 0.420766\n", + " low 0.208967\n", + " not_tested 0.370267\n", + "Nigeria anemia_screening_and_iv_iron_scaleup adequate 0.522017\n", + " low 0.477983\n", " not_tested 0.000000\n", - " baseline adequate 0.077964\n", - " low 0.059170\n", - " not_tested 0.862866\n", - "Pakistan anemia_screening_and_iv_iron_scaleup adequate 0.614561\n", - " low 0.385439\n", + " baseline adequate 0.450574\n", + " low 0.412269\n", + " not_tested 0.137157\n", + " mms_total_scaleup adequate 0.450574\n", + " low 0.412269\n", + " not_tested 0.137157\n", + "Pakistan anemia_screening_and_iv_iron_scaleup adequate 0.562796\n", + " low 0.437204\n", " not_tested 0.000000\n", - " baseline adequate 0.121564\n", - " low 0.077169\n", - " not_tested 0.801267\n", + " baseline adequate 0.450949\n", + " low 0.349227\n", + " not_tested 0.199823\n", + " mms_total_scaleup adequate 0.450949\n", + " low 0.349227\n", + " not_tested 0.199823\n", "Name: value, dtype: float64" ] }, - "execution_count": 13, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" } @@ -589,7 +926,16 @@ { "cell_type": "markdown", "id": "5bb087b7", - "metadata": {}, + "metadata": { + "papermill": { + "duration": 0.01684, + "end_time": "2026-02-19T18:45:49.538300", + "exception": false, + "start_time": "2026-02-19T18:45:49.521460", + "status": "completed" + }, + "tags": [] + }, "source": [ "CHECK: Hemoglobin screening/testing in the baseline scenario matches documented targets (see 2 cells above).\n", "\n", @@ -598,21 +944,36 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 17, "id": "454ec3e5", - "metadata": {}, + "metadata": { + "execution": { + "iopub.execute_input": "2026-02-19T18:45:49.571609Z", + "iopub.status.busy": "2026-02-19T18:45:49.571288Z", + "iopub.status.idle": "2026-02-19T18:45:49.578619Z", + "shell.execute_reply": "2026-02-19T18:45:49.577412Z" + }, + "papermill": { + "duration": 0.025761, + "end_time": "2026-02-19T18:45:49.579598", + "exception": false, + "start_time": "2026-02-19T18:45:49.553837", + "status": "completed" + }, + "tags": [] + }, "outputs": [ { "data": { "text/plain": [ "location\n", - "Ethiopia 0.631026\n", - "Nigeria 0.862866\n", - "Pakistan 0.801267\n", + "Ethiopia 0.370267\n", + "Nigeria 0.137157\n", + "Pakistan 0.199823\n", "Name: value, dtype: float64" ] }, - "execution_count": 14, + "execution_count": 17, "metadata": {}, "output_type": "execute_result" } @@ -625,9 +986,24 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 18, "id": "ae087a5e", - "metadata": {}, + "metadata": { + "execution": { + "iopub.execute_input": "2026-02-19T18:45:49.618164Z", + "iopub.status.busy": "2026-02-19T18:45:49.617856Z", + "iopub.status.idle": "2026-02-19T18:45:49.624287Z", + "shell.execute_reply": "2026-02-19T18:45:49.623085Z" + }, + "papermill": { + "duration": 0.02666, + "end_time": "2026-02-19T18:45:49.625351", + "exception": false, + "start_time": "2026-02-19T18:45:49.598691", + "status": "completed" + }, + "tags": [] + }, "outputs": [ { "data": { @@ -635,7 +1011,7 @@ "['anemia_screening_and_iv_iron_scaleup']" ] }, - "execution_count": 15, + "execution_count": 18, "metadata": {}, "output_type": "execute_result" } @@ -648,7 +1024,16 @@ { "cell_type": "markdown", "id": "2224ca4c", - "metadata": {}, + "metadata": { + "papermill": { + "duration": 0.017221, + "end_time": "2026-02-19T18:45:49.661490", + "exception": false, + "start_time": "2026-02-19T18:45:49.644269", + "status": "completed" + }, + "tags": [] + }, "source": [ "CHECK: Hemoglobin screening/testing in the anemia screening scaleup scenarios is 100%.\n", "\n", @@ -657,9 +1042,24 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 19, "id": "0a672edd", - "metadata": {}, + "metadata": { + "execution": { + "iopub.execute_input": "2026-02-19T18:45:49.696830Z", + "iopub.status.busy": "2026-02-19T18:45:49.696475Z", + "iopub.status.idle": "2026-02-19T18:45:49.702762Z", + "shell.execute_reply": "2026-02-19T18:45:49.701562Z" + }, + "papermill": { + "duration": 0.026124, + "end_time": "2026-02-19T18:45:49.703967", + "exception": false, + "start_time": "2026-02-19T18:45:49.677843", + "status": "completed" + }, + "tags": [] + }, "outputs": [], "source": [ "for scenario in anemia_screening_scaleup_scenarios:\n", @@ -668,20 +1068,36 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 20, "id": "033782d8", - "metadata": {}, + "metadata": { + "execution": { + "iopub.execute_input": "2026-02-19T18:45:49.742941Z", + "iopub.status.busy": "2026-02-19T18:45:49.742650Z", + "iopub.status.idle": "2026-02-19T18:45:49.750440Z", + "shell.execute_reply": "2026-02-19T18:45:49.749058Z" + }, + "papermill": { + "duration": 0.026964, + "end_time": "2026-02-19T18:45:49.751543", + "exception": false, + "start_time": "2026-02-19T18:45:49.724579", + "status": "completed" + }, + "tags": [] + }, "outputs": [ { "data": { "text/plain": [ "scenario\n", "anemia_screening_and_iv_iron_scaleup 0.000000\n", - "baseline 0.631026\n", + "baseline 0.370267\n", + "mms_total_scaleup 0.370267\n", "Name: value, dtype: float64" ] }, - "execution_count": 17, + "execution_count": 20, "metadata": {}, "output_type": "execute_result" } @@ -693,7 +1109,16 @@ { "cell_type": "markdown", "id": "4a2d5549", - "metadata": {}, + "metadata": { + "papermill": { + "duration": 0.018057, + "end_time": "2026-02-19T18:45:49.791606", + "exception": false, + "start_time": "2026-02-19T18:45:49.773549", + "status": "completed" + }, + "tags": [] + }, "source": [ "CHECK: Hemoglobin screening/testing coverage does not differ between scenarios, except scenarios that scale it up.\n", "\n", @@ -702,9 +1127,24 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 21, "id": "ee7394c8", - "metadata": {}, + "metadata": { + "execution": { + "iopub.execute_input": "2026-02-19T18:45:49.857032Z", + "iopub.status.busy": "2026-02-19T18:45:49.856599Z", + "iopub.status.idle": "2026-02-19T18:45:49.865020Z", + "shell.execute_reply": "2026-02-19T18:45:49.863513Z" + }, + "papermill": { + "duration": 0.052708, + "end_time": "2026-02-19T18:45:49.866702", + "exception": false, + "start_time": "2026-02-19T18:45:49.813994", + "status": "completed" + }, + "tags": [] + }, "outputs": [], "source": [ "assert (tested_hemoglobin_exposure_by_scenario[\n", @@ -716,19 +1156,67 @@ { "cell_type": "markdown", "id": "b15b3cd9", - "metadata": {}, + "metadata": { + "papermill": { + "duration": 0.02586, + "end_time": "2026-02-19T18:45:49.931271", + "exception": false, + "start_time": "2026-02-19T18:45:49.905411", + "status": "completed" + }, + "tags": [] + }, "source": [ "CHECK: The amount of tested \"low\" hemoglobin is less in scenarios that scale up MMS relative to those that don't (and don't change anemia screening coverage).\n", "\n", "Type: precise assert (due to CRN)." ] }, + { + "cell_type": "markdown", + "id": "51c7a937", + "metadata": { + "tags": [ + "papermill-error-cell-tag" + ] + }, + "source": [ + "Execution using papermill encountered an exception here and stopped:" + ] + }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 22, "id": "8b84d3f6", - "metadata": {}, - "outputs": [], + "metadata": { + "execution": { + "iopub.execute_input": "2026-02-19T18:45:49.990930Z", + "iopub.status.busy": "2026-02-19T18:45:49.990555Z", + "iopub.status.idle": "2026-02-19T18:45:50.729758Z", + "shell.execute_reply": "2026-02-19T18:45:50.728260Z" + }, + "papermill": { + "duration": 0.772383, + "end_time": "2026-02-19T18:45:50.733181", + "exception": true, + "start_time": "2026-02-19T18:45:49.960798", + "status": "failed" + }, + "tags": [] + }, + "outputs": [ + { + "ename": "AssertionError", + "evalue": "not seeing decreases in testing low in MMS scale-up scenario", + "output_type": "error", + "traceback": [ + "\u001b[31m---------------------------------------------------------------------------\u001b[39m", + "\u001b[31mAssertionError\u001b[39m Traceback (most recent call last)", + "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[22]\u001b[39m\u001b[32m, line 2\u001b[39m\n\u001b[32m 1\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[33m'\u001b[39m\u001b[33mmms_total_scaleup\u001b[39m\u001b[33m'\u001b[39m \u001b[38;5;129;01min\u001b[39;00m scenarios_run:\n\u001b[32m----> \u001b[39m\u001b[32m2\u001b[39m \u001b[38;5;28;01massert\u001b[39;00m (\n\u001b[32m 3\u001b[39m tested_hemoglobin_exposure_by_scenario.loc[(\u001b[38;5;28mslice\u001b[39m(\u001b[38;5;28;01mNone\u001b[39;00m), \u001b[33m\"\u001b[39m\u001b[33mmms_total_scaleup\u001b[39m\u001b[33m\"\u001b[39m, \u001b[33m\"\u001b[39m\u001b[33mlow\u001b[39m\u001b[33m\"\u001b[39m)]\n\u001b[32m 4\u001b[39m <\n\u001b[32m 5\u001b[39m tested_hemoglobin_exposure_by_scenario.loc[(\u001b[38;5;28mslice\u001b[39m(\u001b[38;5;28;01mNone\u001b[39;00m), \u001b[33m\"\u001b[39m\u001b[33mbaseline\u001b[39m\u001b[33m\"\u001b[39m, \u001b[33m\"\u001b[39m\u001b[33mlow\u001b[39m\u001b[33m\"\u001b[39m)]\n\u001b[32m 6\u001b[39m ).all(), \u001b[33m\"\u001b[39m\u001b[33mnot seeing decreases in testing low in MMS scale-up scenario\u001b[39m\u001b[33m\"\u001b[39m\n", + "\u001b[31mAssertionError\u001b[39m: not seeing decreases in testing low in MMS scale-up scenario" + ] + } + ], "source": [ "if 'mms_total_scaleup' in scenarios_run:\n", " assert (\n", @@ -740,34 +1228,19 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": null, "id": "15810322", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "location scenario true_hemoglobin_exposure\n", - "Ethiopia anemia_screening_and_iv_iron_scaleup adequate 0.838319\n", - " low 0.161681\n", - " baseline adequate 0.838319\n", - " low 0.161681\n", - "Nigeria anemia_screening_and_iv_iron_scaleup adequate 0.667414\n", - " low 0.332586\n", - " baseline adequate 0.667414\n", - " low 0.332586\n", - "Pakistan anemia_screening_and_iv_iron_scaleup adequate 0.723430\n", - " low 0.276570\n", - " baseline adequate 0.723430\n", - " low 0.276570\n", - "Name: value, dtype: float64" - ] - }, - "execution_count": 20, - "metadata": {}, - "output_type": "execute_result" - } - ], + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], "source": [ "true_hemoglobin_exposure_by_scenario = (\n", " anc.loc[anc.anc_coverage!='none'].groupby(['location','scenario','true_hemoglobin_exposure'])['value'].sum() \n", @@ -779,7 +1252,16 @@ { "cell_type": "markdown", "id": "aa734016", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: Proportion truly low hemoglobin (<100) is a bit higher in the baseline scenario than in GBD results.\n", "\n", @@ -788,91 +1270,19 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": null, "id": "a5360323", - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/mnt/share/homes/zmbc/mambaforge/envs/vivarium_gates_mncnh_artifact/lib/python3.11/site-packages/db_queries/legacy/get_outputs_helpers/formatting.py:272: UserWarning: When looking for rei_names, we are missing values given rei_set_id: 1. Filling with latest names from rei db table. WARNING: Be very careful if sharing these results with collaborators!!\n", - " warnings.warn(\n" - ] + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" }, - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
valloweruppersim
location_name
Ethiopia0.1440700.0961230.2038530.161681
Nigeria0.2944290.2283680.3563610.332586
Pakistan0.2317110.1387100.3147960.276570
\n", - "
" - ], - "text/plain": [ - " val lower upper sim\n", - "location_name \n", - "Ethiopia 0.144070 0.096123 0.203853 0.161681\n", - "Nigeria 0.294429 0.228368 0.356361 0.332586\n", - "Pakistan 0.231711 0.138710 0.314796 0.276570" - ] - }, - "execution_count": 21, - "metadata": {}, - "output_type": "execute_result" - } - ], + "tags": [] + }, + "outputs": [], "source": [ "from db_queries import get_outputs\n", "\n", @@ -904,7 +1314,16 @@ { "cell_type": "markdown", "id": "73938b3e", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: Proportion truly low hemoglobin (<100) is the same by scenarios that only differ on screening.\n", "\n", @@ -913,9 +1332,18 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": null, "id": "baaf0327", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "outputs": [], "source": [ "if 'anemia_screening_vv' in scenarios_run:\n", @@ -929,7 +1357,16 @@ { "cell_type": "markdown", "id": "2516836e", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: Proportion truly low hemoglobin (<100) is lower in scenarios that scale up MMS.\n", "\n", @@ -938,9 +1375,18 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": null, "id": "66143dff", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "outputs": [], "source": [ "if 'mms_total_scaleup' in scenarios_run:\n", @@ -953,58 +1399,19 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": null, "id": "f0771bca-8968-4666-aeb1-4dc9b8c48230", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "location scenario true_hemoglobin_exposure tested_hemoglobin_exposure\n", - "Ethiopia anemia_screening_and_iv_iron_scaleup adequate adequate 0.799946\n", - " low 0.200054\n", - " not_tested 0.000000\n", - " low adequate 0.150781\n", - " low 0.849219\n", - " not_tested 0.000000\n", - " baseline adequate adequate 0.799941\n", - " low 0.200059\n", - " not_tested 0.000000\n", - " low adequate 0.151532\n", - " low 0.848468\n", - " not_tested 0.000000\n", - "Nigeria anemia_screening_and_iv_iron_scaleup adequate adequate 0.799705\n", - " low 0.200295\n", - " not_tested 0.000000\n", - " low adequate 0.150068\n", - " low 0.849932\n", - " not_tested 0.000000\n", - " baseline adequate adequate 0.798712\n", - " low 0.201288\n", - " not_tested 0.000000\n", - " low adequate 0.150601\n", - " low 0.849399\n", - " not_tested 0.000000\n", - "Pakistan anemia_screening_and_iv_iron_scaleup adequate adequate 0.799788\n", - " low 0.200212\n", - " not_tested 0.000000\n", - " low adequate 0.150687\n", - " low 0.849313\n", - " not_tested 0.000000\n", - " baseline adequate adequate 0.798916\n", - " low 0.201084\n", - " not_tested 0.000000\n", - " low adequate 0.150368\n", - " low 0.849632\n", - " not_tested 0.000000\n", - "Name: value, dtype: float64" - ] - }, - "execution_count": 24, - "metadata": {}, - "output_type": "execute_result" - } - ], + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], "source": [ "# let's check sensitivity and specificity for the hemoglobin screen\n", "\n", @@ -1018,7 +1425,16 @@ { "cell_type": "markdown", "id": "7750181e", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: Proportion truly adequate hemoglobin (>=100) who *test* adequate is approximately 80%, in all scenarios and locations.\n", "\n", @@ -1027,28 +1443,19 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": null, "id": "efedb631", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "location scenario \n", - "Ethiopia anemia_screening_and_iv_iron_scaleup 0.799946\n", - " baseline 0.799941\n", - "Nigeria anemia_screening_and_iv_iron_scaleup 0.799705\n", - " baseline 0.798712\n", - "Pakistan anemia_screening_and_iv_iron_scaleup 0.799788\n", - " baseline 0.798916\n", - "Name: value, dtype: float64" - ] - }, - "execution_count": 25, - "metadata": {}, - "output_type": "execute_result" - } - ], + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], "source": [ "# https://vivarium-research.readthedocs.io/en/latest/models/intervention_models/mncnh_pregnancy/anemia_screening.html#hemoglobin-screening-accuracy-instructions\n", "# Specificity (percent of true negatives that test negative): 80%\n", @@ -1061,7 +1468,16 @@ { "cell_type": "markdown", "id": "b5838cb5", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: Proportion truly low hemoglobin (<100) who *test* low is approximately 85%, in all scenarios and locations.\n", "\n", @@ -1070,28 +1486,19 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": null, "id": "42b8694e", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "location scenario \n", - "Ethiopia anemia_screening_and_iv_iron_scaleup 0.849219\n", - " baseline 0.848468\n", - "Nigeria anemia_screening_and_iv_iron_scaleup 0.849932\n", - " baseline 0.849399\n", - "Pakistan anemia_screening_and_iv_iron_scaleup 0.849313\n", - " baseline 0.849632\n", - "Name: value, dtype: float64" - ] - }, - "execution_count": 26, - "metadata": {}, - "output_type": "execute_result" - } - ], + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], "source": [ "# Sensitivity (percent of true positives that test positive): 85%\n", "# a little confusing, but positive test result refers to low hemoglobin screening value\n", @@ -1103,7 +1510,16 @@ { "cell_type": "markdown", "id": "60e1ca37", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "### ferritin" ] @@ -1111,7 +1527,16 @@ { "cell_type": "markdown", "id": "1f782103", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: Ferritin screening only occurs in anemia screening scaleup scenarios.\n", "\n", @@ -1120,9 +1545,18 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": null, "id": "dad68e46-6d03-4fda-9608-ae4c59294547", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "outputs": [], "source": [ "assert anc.loc[(~anc.scenario.isin(anemia_screening_scaleup_scenarios)) \n", @@ -1132,7 +1566,16 @@ { "cell_type": "markdown", "id": "9e72d73b", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: Ferritin screening only occurs in simulants who go to later-pregnancy ANC.\n", "\n", @@ -1141,9 +1584,18 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": null, "id": "fc117fbe", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "outputs": [], "source": [ "assert anc.loc[(anc.anc_coverage.isin(['none', 'first_trimester_only']))\n", @@ -1153,7 +1605,16 @@ { "cell_type": "markdown", "id": "f07d303c", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: Ferritin screening only occurs in simulants who test low hemoglobin.\n", "\n", @@ -1162,9 +1623,18 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": null, "id": "22df57c5", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "outputs": [], "source": [ "assert anc.loc[(anc.ferritin_status != 'not_tested')\n", @@ -1174,7 +1644,16 @@ { "cell_type": "markdown", "id": "2475e4f5", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: Ferritin screening occurs in 100% of simulants who test low hemoglobin in the anemia screening scale-up scenarios.\n", "\n", @@ -1183,9 +1662,18 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": null, "id": "a80761f1", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "outputs": [], "source": [ "assert anc.loc[(anc.ferritin_status == 'not_tested')\n", @@ -1196,7 +1684,16 @@ { "cell_type": "markdown", "id": "dce877d1", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: The probability of low ferritin among those screened approximately matches the probability of low ferritin in the artifact.\n", "\n", @@ -1205,263 +1702,19 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": null, "id": "5ba10a91", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
countmeanstdmin2.5%50%97.5%max
locationage_startage_endanemia_status_during_pregnancy
Pakistan10.015.0mild250.00.9387050.0113420.8952330.9131050.9406300.9604260.963354
moderate250.00.9002660.0296300.7359360.8222370.9089930.9339680.937613
not_anemic250.00.4693520.0056710.4476160.4565520.4703150.4802130.481677
severe250.00.8790500.0185050.8088620.8421010.8803860.9100610.917687
15.020.0mild250.00.8944410.0122340.8478620.8650170.8967930.9106360.922424
....................................
Nigeria45.050.0severe250.00.6586000.0372660.5676420.5817830.6569050.7312930.739107
50.055.0mild250.00.8155870.0419190.5812560.7249140.8238170.8715330.909352
moderate250.00.6991200.0800720.4627420.5179660.7147830.8185260.828263
not_anemic250.00.4077940.0209600.2906280.3624570.4119080.4357670.454676
severe250.00.6664980.0474460.5623840.5750910.6685710.7577590.767808
\n", - "

108 rows × 8 columns

\n", - "
" - ], - "text/plain": [ - " count mean \\\n", - "location age_start age_end anemia_status_during_pregnancy \n", - "Pakistan 10.0 15.0 mild 250.0 0.938705 \n", - " moderate 250.0 0.900266 \n", - " not_anemic 250.0 0.469352 \n", - " severe 250.0 0.879050 \n", - " 15.0 20.0 mild 250.0 0.894441 \n", - "... ... ... \n", - "Nigeria 45.0 50.0 severe 250.0 0.658600 \n", - " 50.0 55.0 mild 250.0 0.815587 \n", - " moderate 250.0 0.699120 \n", - " not_anemic 250.0 0.407794 \n", - " severe 250.0 0.666498 \n", - "\n", - " std min \\\n", - "location age_start age_end anemia_status_during_pregnancy \n", - "Pakistan 10.0 15.0 mild 0.011342 0.895233 \n", - " moderate 0.029630 0.735936 \n", - " not_anemic 0.005671 0.447616 \n", - " severe 0.018505 0.808862 \n", - " 15.0 20.0 mild 0.012234 0.847862 \n", - "... ... ... \n", - "Nigeria 45.0 50.0 severe 0.037266 0.567642 \n", - " 50.0 55.0 mild 0.041919 0.581256 \n", - " moderate 0.080072 0.462742 \n", - " not_anemic 0.020960 0.290628 \n", - " severe 0.047446 0.562384 \n", - "\n", - " 2.5% 50% \\\n", - "location age_start age_end anemia_status_during_pregnancy \n", - "Pakistan 10.0 15.0 mild 0.913105 0.940630 \n", - " moderate 0.822237 0.908993 \n", - " not_anemic 0.456552 0.470315 \n", - " severe 0.842101 0.880386 \n", - " 15.0 20.0 mild 0.865017 0.896793 \n", - "... ... ... \n", - "Nigeria 45.0 50.0 severe 0.581783 0.656905 \n", - " 50.0 55.0 mild 0.724914 0.823817 \n", - " moderate 0.517966 0.714783 \n", - " not_anemic 0.362457 0.411908 \n", - " severe 0.575091 0.668571 \n", - "\n", - " 97.5% max \n", - "location age_start age_end anemia_status_during_pregnancy \n", - "Pakistan 10.0 15.0 mild 0.960426 0.963354 \n", - " moderate 0.933968 0.937613 \n", - " not_anemic 0.480213 0.481677 \n", - " severe 0.910061 0.917687 \n", - " 15.0 20.0 mild 0.910636 0.922424 \n", - "... ... ... \n", - "Nigeria 45.0 50.0 severe 0.731293 0.739107 \n", - " 50.0 55.0 mild 0.871533 0.909352 \n", - " moderate 0.818526 0.828263 \n", - " not_anemic 0.435767 0.454676 \n", - " severe 0.757759 0.767808 \n", - "\n", - "[108 rows x 8 columns]" - ] - }, - "execution_count": 31, - "metadata": {}, - "output_type": "execute_result" - } - ], + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], "source": [ "draws = [f'draw_{draw}' for draw in anc.input_draw.unique()]\n", "probability_low_ferritin_targets = pd.concat([\n", @@ -1473,1354 +1726,123 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": null, "id": "ed073e5f", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
countmeanstdmin2.5%50%97.5%max
locationanemia_status_during_pregnancyage_group
Pakistanmild10_to_14250.00.9387050.0113420.8952330.9131050.9406300.9604260.963354
moderate10_to_14250.00.9002660.0296300.7359360.8222370.9089930.9339680.937613
not_anemic10_to_14250.00.4693520.0056710.4476160.4565520.4703150.4802130.481677
severe10_to_14250.00.8790500.0185050.8088620.8421010.8803860.9100610.917687
mild15_to_19250.00.8944410.0122340.8478620.8650170.8967930.9106360.922424
.................................
Nigeriasevere45_to_49250.00.6586000.0372660.5676420.5817830.6569050.7312930.739107
mild50_to_54250.00.8155870.0419190.5812560.7249140.8238170.8715330.909352
moderate50_to_54250.00.6991200.0800720.4627420.5179660.7147830.8185260.828263
not_anemic50_to_54250.00.4077940.0209600.2906280.3624570.4119080.4357670.454676
severe50_to_54250.00.6664980.0474460.5623840.5750910.6685710.7577590.767808
\n", - "

108 rows × 8 columns

\n", - "
" - ], - "text/plain": [ - " count mean std \\\n", - "location anemia_status_during_pregnancy age_group \n", - "Pakistan mild 10_to_14 250.0 0.938705 0.011342 \n", - " moderate 10_to_14 250.0 0.900266 0.029630 \n", - " not_anemic 10_to_14 250.0 0.469352 0.005671 \n", - " severe 10_to_14 250.0 0.879050 0.018505 \n", - " mild 15_to_19 250.0 0.894441 0.012234 \n", - "... ... ... ... \n", - "Nigeria severe 45_to_49 250.0 0.658600 0.037266 \n", - " mild 50_to_54 250.0 0.815587 0.041919 \n", - " moderate 50_to_54 250.0 0.699120 0.080072 \n", - " not_anemic 50_to_54 250.0 0.407794 0.020960 \n", - " severe 50_to_54 250.0 0.666498 0.047446 \n", - "\n", - " min 2.5% \\\n", - "location anemia_status_during_pregnancy age_group \n", - "Pakistan mild 10_to_14 0.895233 0.913105 \n", - " moderate 10_to_14 0.735936 0.822237 \n", - " not_anemic 10_to_14 0.447616 0.456552 \n", - " severe 10_to_14 0.808862 0.842101 \n", - " mild 15_to_19 0.847862 0.865017 \n", - "... ... ... \n", - "Nigeria severe 45_to_49 0.567642 0.581783 \n", - " mild 50_to_54 0.581256 0.724914 \n", - " moderate 50_to_54 0.462742 0.517966 \n", - " not_anemic 50_to_54 0.290628 0.362457 \n", - " severe 50_to_54 0.562384 0.575091 \n", - "\n", - " 50% 97.5% \\\n", - "location anemia_status_during_pregnancy age_group \n", - "Pakistan mild 10_to_14 0.940630 0.960426 \n", - " moderate 10_to_14 0.908993 0.933968 \n", - " not_anemic 10_to_14 0.470315 0.480213 \n", - " severe 10_to_14 0.880386 0.910061 \n", - " mild 15_to_19 0.896793 0.910636 \n", - "... ... ... \n", - "Nigeria severe 45_to_49 0.656905 0.731293 \n", - " mild 50_to_54 0.823817 0.871533 \n", - " moderate 50_to_54 0.714783 0.818526 \n", - " not_anemic 50_to_54 0.411908 0.435767 \n", - " severe 50_to_54 0.668571 0.757759 \n", - "\n", - " max \n", - "location anemia_status_during_pregnancy age_group \n", - "Pakistan mild 10_to_14 0.963354 \n", - " moderate 10_to_14 0.937613 \n", - " not_anemic 10_to_14 0.481677 \n", - " severe 10_to_14 0.917687 \n", - " mild 15_to_19 0.922424 \n", - "... ... \n", - "Nigeria severe 45_to_49 0.739107 \n", - " mild 50_to_54 0.909352 \n", - " moderate 50_to_54 0.828263 \n", - " not_anemic 50_to_54 0.454676 \n", - " severe 50_to_54 0.767808 \n", - "\n", - "[108 rows x 8 columns]" - ] - }, - "execution_count": 32, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "probability_low_ferritin_targets['age_group'] = (\n", - " probability_low_ferritin_targets.index.get_level_values('age_start').astype(int).astype(str)\n", - " + '_to_'\n", - " + (probability_low_ferritin_targets.index.get_level_values('age_end').astype(int) - 1).astype(str)\n", - ")\n", - "\n", - "probability_low_ferritin_targets = probability_low_ferritin_targets.droplevel(['age_start', 'age_end']).set_index('age_group', append=True)\n", - "probability_low_ferritin_targets" - ] - }, - { - "cell_type": "code", - "execution_count": 33, - "id": "2e41b9bd", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
anemia_status_during_pregnancybound1bound2
locationage_grouptrue_hemoglobin_exposure
Ethiopia10_to_14low0.7103220.641149
15_to_19low0.6695800.644903
20_to_24low0.6854280.649065
25_to_29low0.6811940.641526
30_to_34low0.6964520.644095
35_to_39low0.7032790.643632
40_to_44low0.6618460.621613
45_to_49low0.6749250.632734
50_to_54low0.6987010.649603
Nigeria10_to_14low0.6990620.646273
15_to_19low0.6979270.647912
20_to_24low0.7217070.670437
25_to_29low0.7109260.662829
30_to_34low0.7164970.663598
35_to_39low0.6945970.648507
40_to_44low0.6886630.643697
45_to_49low0.6844520.658600
50_to_54low0.6991200.666498
Pakistan10_to_14low0.9002660.879050
15_to_19low0.8541600.840061
20_to_24low0.8440600.836409
25_to_29low0.8461170.838762
30_to_34low0.8475590.841024
35_to_39low0.8516460.844255
40_to_44low0.8512870.842165
45_to_49low0.8498620.840028
50_to_54low0.8611070.848223
Ethiopia10_to_14adequate0.4339870.867973
15_to_19adequate0.3971610.794323
20_to_24adequate0.4051800.810361
25_to_29adequate0.4044200.808840
30_to_34adequate0.4088740.817749
35_to_39adequate0.4114470.822894
40_to_44adequate0.3982330.796467
45_to_49adequate0.4009040.801808
50_to_54adequate0.4106670.821334
Nigeria10_to_14adequate0.4305730.861146
15_to_19adequate0.4186560.837313
20_to_24adequate0.4219160.843833
25_to_29adequate0.4151410.830282
30_to_34adequate0.4187430.837486
35_to_39adequate0.4164560.832912
40_to_44adequate0.4145310.829061
45_to_49adequate0.4047970.809594
50_to_54adequate0.4077940.815587
Pakistan10_to_14adequate0.4693520.938705
15_to_19adequate0.4472210.894441
20_to_24adequate0.4435320.887063
25_to_29adequate0.4439680.887937
30_to_34adequate0.4436870.887374
35_to_39adequate0.4450890.890179
40_to_44adequate0.4460020.892004
45_to_49adequate0.4458250.891650
50_to_54adequate0.4491200.898240
\n", - "
" - ], - "text/plain": [ - "anemia_status_during_pregnancy bound1 bound2\n", - "location age_group true_hemoglobin_exposure \n", - "Ethiopia 10_to_14 low 0.710322 0.641149\n", - " 15_to_19 low 0.669580 0.644903\n", - " 20_to_24 low 0.685428 0.649065\n", - " 25_to_29 low 0.681194 0.641526\n", - " 30_to_34 low 0.696452 0.644095\n", - " 35_to_39 low 0.703279 0.643632\n", - " 40_to_44 low 0.661846 0.621613\n", - " 45_to_49 low 0.674925 0.632734\n", - " 50_to_54 low 0.698701 0.649603\n", - "Nigeria 10_to_14 low 0.699062 0.646273\n", - " 15_to_19 low 0.697927 0.647912\n", - " 20_to_24 low 0.721707 0.670437\n", - " 25_to_29 low 0.710926 0.662829\n", - " 30_to_34 low 0.716497 0.663598\n", - " 35_to_39 low 0.694597 0.648507\n", - " 40_to_44 low 0.688663 0.643697\n", - " 45_to_49 low 0.684452 0.658600\n", - " 50_to_54 low 0.699120 0.666498\n", - "Pakistan 10_to_14 low 0.900266 0.879050\n", - " 15_to_19 low 0.854160 0.840061\n", - " 20_to_24 low 0.844060 0.836409\n", - " 25_to_29 low 0.846117 0.838762\n", - " 30_to_34 low 0.847559 0.841024\n", - " 35_to_39 low 0.851646 0.844255\n", - " 40_to_44 low 0.851287 0.842165\n", - " 45_to_49 low 0.849862 0.840028\n", - " 50_to_54 low 0.861107 0.848223\n", - "Ethiopia 10_to_14 adequate 0.433987 0.867973\n", - " 15_to_19 adequate 0.397161 0.794323\n", - " 20_to_24 adequate 0.405180 0.810361\n", - " 25_to_29 adequate 0.404420 0.808840\n", - " 30_to_34 adequate 0.408874 0.817749\n", - " 35_to_39 adequate 0.411447 0.822894\n", - " 40_to_44 adequate 0.398233 0.796467\n", - " 45_to_49 adequate 0.400904 0.801808\n", - " 50_to_54 adequate 0.410667 0.821334\n", - "Nigeria 10_to_14 adequate 0.430573 0.861146\n", - " 15_to_19 adequate 0.418656 0.837313\n", - " 20_to_24 adequate 0.421916 0.843833\n", - " 25_to_29 adequate 0.415141 0.830282\n", - " 30_to_34 adequate 0.418743 0.837486\n", - " 35_to_39 adequate 0.416456 0.832912\n", - " 40_to_44 adequate 0.414531 0.829061\n", - " 45_to_49 adequate 0.404797 0.809594\n", - " 50_to_54 adequate 0.407794 0.815587\n", - "Pakistan 10_to_14 adequate 0.469352 0.938705\n", - " 15_to_19 adequate 0.447221 0.894441\n", - " 20_to_24 adequate 0.443532 0.887063\n", - " 25_to_29 adequate 0.443968 0.887937\n", - " 30_to_34 adequate 0.443687 0.887374\n", - " 35_to_39 adequate 0.445089 0.890179\n", - " 40_to_44 adequate 0.446002 0.892004\n", - " 45_to_49 adequate 0.445825 0.891650\n", - " 50_to_54 adequate 0.449120 0.898240" - ] - }, - "execution_count": 33, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "means_by_category = probability_low_ferritin_targets['mean'].unstack('anemia_status_during_pregnancy')\n", - "# We have to map low/adequate to the anemia categories, which is not exact and makes this all a bit handwavey;\n", - "# the value we observe from the sim will be some weighted mix of these two \"bounds\"\n", - "probability_low_ferritin_targets = pd.concat([\n", - " # 'low' corresponds to below 100, which means moderate or severe\n", - " means_by_category[['moderate', 'severe']].rename(columns={'moderate': 'bound1', 'severe': 'bound2'})\n", - " .assign(true_hemoglobin_exposure='low')\n", - " .set_index('true_hemoglobin_exposure', append=True),\n", - " # 'adequate' corresponds to above 100, which means mild or not_anemic\n", - " means_by_category[['mild', 'not_anemic']].rename(columns={'not_anemic': 'bound1', 'mild': 'bound2'})\n", - " .assign(true_hemoglobin_exposure='adequate')\n", - " .set_index('true_hemoglobin_exposure', append=True),\n", - "])\n", - "probability_low_ferritin_targets" - ] - }, - { - "cell_type": "code", - "execution_count": 34, - "id": "5adf45ba-9d5b-47f9-9b0e-6ca62a1ecd10", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "scenario location age_group true_hemoglobin_exposure\n", - "anemia_screening_and_iv_iron_scaleup Ethiopia 10_to_14 adequate 0.565872\n", - " low 0.707055\n", - " 15_to_19 adequate 0.471741\n", - " low 0.666746\n", - " 20_to_24 adequate 0.480983\n", - " low 0.670774\n", - " 25_to_29 adequate 0.482515\n", - " low 0.668747\n", - " 30_to_34 adequate 0.487523\n", - " low 0.666793\n", - " 35_to_39 adequate 0.491576\n", - " low 0.663895\n", - " 40_to_44 adequate 0.481083\n", - " low 0.654654\n", - " 45_to_49 adequate 0.475758\n", - " low 0.655075\n", - " 50_to_54 adequate 0.439394\n", - " low 0.682540\n", - " Nigeria 10_to_14 adequate 0.605588\n", - " low 0.697061\n", - " 15_to_19 adequate 0.607293\n", - " low 0.702169\n", - " 20_to_24 adequate 0.593470\n", - " low 0.728079\n", - " 25_to_29 adequate 0.577538\n", - " low 0.721813\n", - " 30_to_34 adequate 0.590508\n", - " low 0.723184\n", - " 35_to_39 adequate 0.591539\n", - " low 0.703992\n", - " 40_to_44 adequate 0.609483\n", - " low 0.698462\n", - " 45_to_49 adequate 0.599886\n", - " low 0.694054\n", - " 50_to_54 adequate 0.514019\n", - " low 0.689796\n", - " Pakistan 10_to_14 adequate 0.637076\n", - " low 0.877211\n", - " 15_to_19 adequate 0.587847\n", - " low 0.853682\n", - " 20_to_24 adequate 0.586367\n", - " low 0.842135\n", - " 25_to_29 adequate 0.585370\n", - " low 0.843718\n", - " 30_to_34 adequate 0.578200\n", - " low 0.844467\n", - " 35_to_39 adequate 0.578427\n", - " low 0.851293\n", - " 40_to_44 adequate 0.580789\n", - " low 0.841697\n", - " 45_to_49 adequate 0.584702\n", - " low 0.846063\n", - " 50_to_54 adequate 0.669725\n", - " low 0.860360\n", - "Name: value, dtype: float64" - ] - }, - "execution_count": 34, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "ferritin_results_by_scenario = (\n", - " anc.loc[anc.scenario.isin(anemia_screening_scaleup_scenarios) & (anc.ferritin_status == 'low')].groupby(['scenario', 'location', 'age_group', 'true_hemoglobin_exposure'])['value'].sum()\n", - " /\n", - " anc.loc[anc.scenario.isin(anemia_screening_scaleup_scenarios) & (anc.ferritin_status != 'not_tested')].groupby(['scenario', 'location', 'age_group', 'true_hemoglobin_exposure'])['value'].sum()\n", - ").dropna()\n", - "ferritin_results_by_scenario" - ] - }, - { - "cell_type": "code", - "execution_count": 35, - "id": "5602b7a9", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "location age_group true_hemoglobin_exposure\n", - "Ethiopia 10_to_14 adequate 0.565872\n", - " low 0.707055\n", - " 15_to_19 adequate 0.471741\n", - " low 0.666746\n", - " 20_to_24 adequate 0.480983\n", - " low 0.670774\n", - " 25_to_29 adequate 0.482515\n", - " low 0.668747\n", - " 30_to_34 adequate 0.487523\n", - " low 0.666793\n", - " 35_to_39 adequate 0.491576\n", - " low 0.663895\n", - " 40_to_44 adequate 0.481083\n", - " low 0.654654\n", - " 45_to_49 adequate 0.475758\n", - " low 0.655075\n", - " 50_to_54 adequate 0.439394\n", - " low 0.682540\n", - "Nigeria 10_to_14 adequate 0.605588\n", - " low 0.697061\n", - " 15_to_19 adequate 0.607293\n", - " low 0.702169\n", - " 20_to_24 adequate 0.593470\n", - " low 0.728079\n", - " 25_to_29 adequate 0.577538\n", - " low 0.721813\n", - " 30_to_34 adequate 0.590508\n", - " low 0.723184\n", - " 35_to_39 adequate 0.591539\n", - " low 0.703992\n", - " 40_to_44 adequate 0.609483\n", - " low 0.698462\n", - " 45_to_49 adequate 0.599886\n", - " low 0.694054\n", - " 50_to_54 adequate 0.514019\n", - " low 0.689796\n", - "Pakistan 10_to_14 adequate 0.637076\n", - " low 0.877211\n", - " 15_to_19 adequate 0.587847\n", - " low 0.853682\n", - " 20_to_24 adequate 0.586367\n", - " low 0.842135\n", - " 25_to_29 adequate 0.585370\n", - " low 0.843718\n", - " 30_to_34 adequate 0.578200\n", - " low 0.844467\n", - " 35_to_39 adequate 0.578427\n", - " low 0.851293\n", - " 40_to_44 adequate 0.580789\n", - " low 0.841697\n", - " 45_to_49 adequate 0.584702\n", - " low 0.846063\n", - " 50_to_54 adequate 0.669725\n", - " low 0.860360\n", - "Name: value, dtype: float64" - ] - }, - "execution_count": 35, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "assert (ferritin_results_by_scenario.groupby([c for c in ferritin_results_by_scenario.index.names if c != 'scenario']).nunique() == 1).all(), \"ferritin results differ between scaleup scenarios\"\n", - "\n", - "ferritin_results = ferritin_results_by_scenario.groupby([c for c in ferritin_results_by_scenario.index.names if c != 'scenario']).first()\n", - "ferritin_results" - ] - }, - { - "cell_type": "code", - "execution_count": 36, - "id": "f5ec627a", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
simbound1bound2
locationage_grouptrue_hemoglobin_exposure
Ethiopia10_to_14adequate0.5658720.4339870.867973
low0.7070550.7103220.641149
15_to_19adequate0.4717410.3971610.794323
low0.6667460.6695800.644903
20_to_24adequate0.4809830.4051800.810361
low0.6707740.6854280.649065
25_to_29adequate0.4825150.4044200.808840
low0.6687470.6811940.641526
30_to_34adequate0.4875230.4088740.817749
low0.6667930.6964520.644095
35_to_39adequate0.4915760.4114470.822894
low0.6638950.7032790.643632
40_to_44adequate0.4810830.3982330.796467
low0.6546540.6618460.621613
45_to_49adequate0.4757580.4009040.801808
low0.6550750.6749250.632734
50_to_54adequate0.4393940.4106670.821334
low0.6825400.6987010.649603
Nigeria10_to_14adequate0.6055880.4305730.861146
low0.6970610.6990620.646273
15_to_19adequate0.6072930.4186560.837313
low0.7021690.6979270.647912
20_to_24adequate0.5934700.4219160.843833
low0.7280790.7217070.670437
25_to_29adequate0.5775380.4151410.830282
low0.7218130.7109260.662829
30_to_34adequate0.5905080.4187430.837486
low0.7231840.7164970.663598
35_to_39adequate0.5915390.4164560.832912
low0.7039920.6945970.648507
40_to_44adequate0.6094830.4145310.829061
low0.6984620.6886630.643697
45_to_49adequate0.5998860.4047970.809594
low0.6940540.6844520.658600
50_to_54adequate0.5140190.4077940.815587
low0.6897960.6991200.666498
Pakistan10_to_14adequate0.6370760.4693520.938705
low0.8772110.9002660.879050
15_to_19adequate0.5878470.4472210.894441
low0.8536820.8541600.840061
20_to_24adequate0.5863670.4435320.887063
low0.8421350.8440600.836409
25_to_29adequate0.5853700.4439680.887937
low0.8437180.8461170.838762
30_to_34adequate0.5782000.4436870.887374
low0.8444670.8475590.841024
35_to_39adequate0.5784270.4450890.890179
low0.8512930.8516460.844255
40_to_44adequate0.5807890.4460020.892004
low0.8416970.8512870.842165
45_to_49adequate0.5847020.4458250.891650
low0.8460630.8498620.840028
50_to_54adequate0.6697250.4491200.898240
low0.8603600.8611070.848223
\n", - "
" - ], - "text/plain": [ - " sim bound1 bound2\n", - "location age_group true_hemoglobin_exposure \n", - "Ethiopia 10_to_14 adequate 0.565872 0.433987 0.867973\n", - " low 0.707055 0.710322 0.641149\n", - " 15_to_19 adequate 0.471741 0.397161 0.794323\n", - " low 0.666746 0.669580 0.644903\n", - " 20_to_24 adequate 0.480983 0.405180 0.810361\n", - " low 0.670774 0.685428 0.649065\n", - " 25_to_29 adequate 0.482515 0.404420 0.808840\n", - " low 0.668747 0.681194 0.641526\n", - " 30_to_34 adequate 0.487523 0.408874 0.817749\n", - " low 0.666793 0.696452 0.644095\n", - " 35_to_39 adequate 0.491576 0.411447 0.822894\n", - " low 0.663895 0.703279 0.643632\n", - " 40_to_44 adequate 0.481083 0.398233 0.796467\n", - " low 0.654654 0.661846 0.621613\n", - " 45_to_49 adequate 0.475758 0.400904 0.801808\n", - " low 0.655075 0.674925 0.632734\n", - " 50_to_54 adequate 0.439394 0.410667 0.821334\n", - " low 0.682540 0.698701 0.649603\n", - "Nigeria 10_to_14 adequate 0.605588 0.430573 0.861146\n", - " low 0.697061 0.699062 0.646273\n", - " 15_to_19 adequate 0.607293 0.418656 0.837313\n", - " low 0.702169 0.697927 0.647912\n", - " 20_to_24 adequate 0.593470 0.421916 0.843833\n", - " low 0.728079 0.721707 0.670437\n", - " 25_to_29 adequate 0.577538 0.415141 0.830282\n", - " low 0.721813 0.710926 0.662829\n", - " 30_to_34 adequate 0.590508 0.418743 0.837486\n", - " low 0.723184 0.716497 0.663598\n", - " 35_to_39 adequate 0.591539 0.416456 0.832912\n", - " low 0.703992 0.694597 0.648507\n", - " 40_to_44 adequate 0.609483 0.414531 0.829061\n", - " low 0.698462 0.688663 0.643697\n", - " 45_to_49 adequate 0.599886 0.404797 0.809594\n", - " low 0.694054 0.684452 0.658600\n", - " 50_to_54 adequate 0.514019 0.407794 0.815587\n", - " low 0.689796 0.699120 0.666498\n", - "Pakistan 10_to_14 adequate 0.637076 0.469352 0.938705\n", - " low 0.877211 0.900266 0.879050\n", - " 15_to_19 adequate 0.587847 0.447221 0.894441\n", - " low 0.853682 0.854160 0.840061\n", - " 20_to_24 adequate 0.586367 0.443532 0.887063\n", - " low 0.842135 0.844060 0.836409\n", - " 25_to_29 adequate 0.585370 0.443968 0.887937\n", - " low 0.843718 0.846117 0.838762\n", - " 30_to_34 adequate 0.578200 0.443687 0.887374\n", - " low 0.844467 0.847559 0.841024\n", - " 35_to_39 adequate 0.578427 0.445089 0.890179\n", - " low 0.851293 0.851646 0.844255\n", - " 40_to_44 adequate 0.580789 0.446002 0.892004\n", - " low 0.841697 0.851287 0.842165\n", - " 45_to_49 adequate 0.584702 0.445825 0.891650\n", - " low 0.846063 0.849862 0.840028\n", - " 50_to_54 adequate 0.669725 0.449120 0.898240\n", - " low 0.860360 0.861107 0.848223" - ] - }, - "execution_count": 36, - "metadata": {}, - "output_type": "execute_result" - } - ], + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "probability_low_ferritin_targets['age_group'] = (\n", + " probability_low_ferritin_targets.index.get_level_values('age_start').astype(int).astype(str)\n", + " + '_to_'\n", + " + (probability_low_ferritin_targets.index.get_level_values('age_end').astype(int) - 1).astype(str)\n", + ")\n", + "\n", + "probability_low_ferritin_targets = probability_low_ferritin_targets.droplevel(['age_start', 'age_end']).set_index('age_group', append=True)\n", + "probability_low_ferritin_targets" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2e41b9bd", + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "means_by_category = probability_low_ferritin_targets['mean'].unstack('anemia_status_during_pregnancy')\n", + "# We have to map low/adequate to the anemia categories, which is not exact and makes this all a bit handwavey;\n", + "# the value we observe from the sim will be some weighted mix of these two \"bounds\"\n", + "probability_low_ferritin_targets = pd.concat([\n", + " # 'low' corresponds to below 100, which means moderate or severe\n", + " means_by_category[['moderate', 'severe']].rename(columns={'moderate': 'bound1', 'severe': 'bound2'})\n", + " .assign(true_hemoglobin_exposure='low')\n", + " .set_index('true_hemoglobin_exposure', append=True),\n", + " # 'adequate' corresponds to above 100, which means mild or not_anemic\n", + " means_by_category[['mild', 'not_anemic']].rename(columns={'not_anemic': 'bound1', 'mild': 'bound2'})\n", + " .assign(true_hemoglobin_exposure='adequate')\n", + " .set_index('true_hemoglobin_exposure', append=True),\n", + "])\n", + "probability_low_ferritin_targets" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5adf45ba-9d5b-47f9-9b0e-6ca62a1ecd10", + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "ferritin_results_by_scenario = (\n", + " anc.loc[anc.scenario.isin(anemia_screening_scaleup_scenarios) & (anc.ferritin_status == 'low')].groupby(['scenario', 'location', 'age_group', 'true_hemoglobin_exposure'])['value'].sum()\n", + " /\n", + " anc.loc[anc.scenario.isin(anemia_screening_scaleup_scenarios) & (anc.ferritin_status != 'not_tested')].groupby(['scenario', 'location', 'age_group', 'true_hemoglobin_exposure'])['value'].sum()\n", + ").dropna()\n", + "ferritin_results_by_scenario" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5602b7a9", + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "assert (ferritin_results_by_scenario.groupby([c for c in ferritin_results_by_scenario.index.names if c != 'scenario']).nunique() == 1).all(), \"ferritin results differ between scaleup scenarios\"\n", + "\n", + "ferritin_results = ferritin_results_by_scenario.groupby([c for c in ferritin_results_by_scenario.index.names if c != 'scenario']).first()\n", + "ferritin_results" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f5ec627a", + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], "source": [ "comparison = ferritin_results.rename('sim').to_frame().join(probability_low_ferritin_targets.reorder_levels(ferritin_results.index.names))\n", "comparison\n", @@ -2830,135 +1852,19 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": null, "id": "0f387927", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
simbound1bound2
locationage_grouptrue_hemoglobin_exposure
Nigeria15_to_19low0.7021690.6979270.647912
20_to_24low0.7280790.7217070.670437
25_to_29low0.7218130.7109260.662829
30_to_34low0.7231840.7164970.663598
35_to_39low0.7039920.6945970.648507
40_to_44low0.6984620.6886630.643697
45_to_49low0.6940540.6844520.658600
Pakistan10_to_14low0.8772110.9002660.879050
40_to_44low0.8416970.8512870.842165
\n", - "
" - ], - "text/plain": [ - " sim bound1 bound2\n", - "location age_group true_hemoglobin_exposure \n", - "Nigeria 15_to_19 low 0.702169 0.697927 0.647912\n", - " 20_to_24 low 0.728079 0.721707 0.670437\n", - " 25_to_29 low 0.721813 0.710926 0.662829\n", - " 30_to_34 low 0.723184 0.716497 0.663598\n", - " 35_to_39 low 0.703992 0.694597 0.648507\n", - " 40_to_44 low 0.698462 0.688663 0.643697\n", - " 45_to_49 low 0.694054 0.684452 0.658600\n", - "Pakistan 10_to_14 low 0.877211 0.900266 0.879050\n", - " 40_to_44 low 0.841697 0.851287 0.842165" - ] - }, - "execution_count": 37, - "metadata": {}, - "output_type": "execute_result" - } - ], + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], "source": [ "# As we can see there are a few cases where the sim value is outside the bounds of the means, particularly in Nigeria (why?)\n", "\n", @@ -2968,7 +1874,16 @@ { "cell_type": "markdown", "id": "944b9f4e", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "## checks on iron interventions" ] @@ -2976,7 +1891,16 @@ { "cell_type": "markdown", "id": "3ad47617", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "### oral iron" ] @@ -2984,7 +1908,16 @@ { "cell_type": "markdown", "id": "6e50e9b1", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: Oral iron only received by simulants who attend ANC.\n", "\n", @@ -2993,9 +1926,18 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": null, "id": "94ac6145-739b-4928-8d83-51d0a663a499", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "outputs": [], "source": [ "assert anc.loc[(anc.anc_coverage=='none')\n", @@ -3005,7 +1947,16 @@ { "cell_type": "markdown", "id": "0aad40ba", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: MMS only received in scenarios that scale it up.\n", "\n", @@ -3014,9 +1965,18 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": null, "id": "22e1580e", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "outputs": [], "source": [ "assert anc.loc[\n", @@ -3028,7 +1988,16 @@ { "cell_type": "markdown", "id": "c63a9698", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: MMS received by every simulant who attends ANC in the scenarios that fully scale up MMS.\n", "\n", @@ -3037,9 +2006,18 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": null, "id": "b84a9fe4", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "outputs": [], "source": [ "assert anc.loc[\n", @@ -3052,7 +2030,16 @@ { "cell_type": "markdown", "id": "09163047", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: IFA coverage is the same between baseline and anemia screening scenarios.\n", "\n", @@ -3061,9 +2048,18 @@ }, { "cell_type": "code", - "execution_count": 41, + "execution_count": null, "id": "1d51cd45", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "outputs": [], "source": [ "if 'anemia_screening_vv' in scenarios_run:\n", @@ -3078,25 +2074,19 @@ }, { "cell_type": "code", - "execution_count": 42, + "execution_count": null, "id": "099be604", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "location\n", - "Ethiopia 0.560457\n", - "Nigeria 0.834046\n", - "Pakistan 0.720089\n", - "Name: mean, dtype: float64" - ] - }, - "execution_count": 42, - "metadata": {}, - "output_type": "execute_result" - } - ], + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], "source": [ "# https://vivarium-research.readthedocs.io/en/latest/models/intervention_models/mncnh_pregnancy/oral_iron_antenatal/oral_iron_antenatal.html#baseline-coverage-data\n", "baseline_ifa_coverage_targets = pd.read_csv(\n", @@ -3114,7 +2104,16 @@ { "cell_type": "markdown", "id": "ddffe83a", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: IFA coverage in the baseline scenario matches documented targets.\n", "\n", @@ -3123,109 +2122,19 @@ }, { "cell_type": "code", - "execution_count": 43, + "execution_count": null, "id": "414bdf57", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
countmeanstdmin25%50%75%max
location
Ethiopia10.00.5545730.0231170.5298850.5402210.5518960.5574060.613813
Nigeria10.00.8302110.0138210.8152930.8224220.8288790.8320150.864637
Pakistan10.00.7169150.0190050.6876550.7068820.7230060.7266220.750151
\n", - "
" - ], - "text/plain": [ - " count mean std min 25% 50% 75% \\\n", - "location \n", - "Ethiopia 10.0 0.554573 0.023117 0.529885 0.540221 0.551896 0.557406 \n", - "Nigeria 10.0 0.830211 0.013821 0.815293 0.822422 0.828879 0.832015 \n", - "Pakistan 10.0 0.716915 0.019005 0.687655 0.706882 0.723006 0.726622 \n", - "\n", - " max \n", - "location \n", - "Ethiopia 0.613813 \n", - "Nigeria 0.864637 \n", - "Pakistan 0.750151 " - ] - }, - "execution_count": 43, - "metadata": {}, - "output_type": "execute_result" - } - ], + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], "source": [ "(\n", " anc.loc[(anc.anc_coverage!='none') & (anc.scenario == 'baseline') & (anc.oral_iron_coverage == 'ifa')].groupby(['location', 'input_draw'])['value'].sum()\n", @@ -3239,7 +2148,16 @@ { "cell_type": "markdown", "id": "a08408f5", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: Observed RR of IFA on pregnancy outcome is approximately 1, comparing *simulants* within the baseline scenario.\n", "\n", @@ -3248,58 +2166,19 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": null, "id": "d70740c2", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "location anc_coverage pregnancy_outcome\n", - "Ethiopia first_trimester_and_later_pregnancy live_birth 1.000147\n", - " partial_term NaN\n", - " stillbirth 0.996036\n", - " first_trimester_only live_birth 1.018341\n", - " partial_term 0.999203\n", - " stillbirth 0.958332\n", - " later_pregnancy_only live_birth 1.000100\n", - " partial_term NaN\n", - " stillbirth 0.997301\n", - " none live_birth NaN\n", - " partial_term NaN\n", - " stillbirth NaN\n", - "Nigeria first_trimester_and_later_pregnancy live_birth 0.999804\n", - " partial_term NaN\n", - " stillbirth 1.004724\n", - " first_trimester_only live_birth NaN\n", - " partial_term 1.000000\n", - " stillbirth NaN\n", - " later_pregnancy_only live_birth 0.999786\n", - " partial_term NaN\n", - " stillbirth 1.005200\n", - " none live_birth NaN\n", - " partial_term NaN\n", - " stillbirth NaN\n", - "Pakistan first_trimester_and_later_pregnancy live_birth 0.999157\n", - " partial_term NaN\n", - " stillbirth 1.013805\n", - " first_trimester_only live_birth 1.003683\n", - " partial_term 0.993268\n", - " stillbirth 0.990742\n", - " later_pregnancy_only live_birth 0.999907\n", - " partial_term NaN\n", - " stillbirth 1.001514\n", - " none live_birth NaN\n", - " partial_term NaN\n", - " stillbirth NaN\n", - "Name: value, dtype: float64" - ] - }, - "execution_count": 44, - "metadata": {}, - "output_type": "execute_result" - } - ], + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], "source": [ "# Now checking the effects\n", "# If we ran only the baseline scenario, we can still approximately (without CRN) check the IFA effect on birth outcomes (which is no effect)\n", @@ -3322,24 +2201,19 @@ }, { "cell_type": "code", - "execution_count": 45, + "execution_count": null, "id": "c688e196", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "scenario\n", - "anemia_screening_and_iv_iron_scaleup 0.482035\n", - "baseline 0.482035\n", - "Name: value, dtype: float64" - ] - }, - "execution_count": 45, - "metadata": {}, - "output_type": "execute_result" - } - ], + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], "source": [ "# NOTE: We don't have an IFA scale-up scenario to be able to do a cross-scenario comparison\n", "(anc[anc.oral_iron_coverage == 'ifa'].groupby(['scenario'])['value'].sum() / anc.groupby(['scenario'])['value'].sum()).sort_values()" @@ -3347,40 +2221,19 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": null, "id": "8245625a", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "location scenario pregnancy_outcome\n", - "Ethiopia anemia_screening_and_iv_iron_scaleup live_birth 0.535455\n", - " partial_term 0.444812\n", - " stillbirth 0.019734\n", - " baseline live_birth 0.535455\n", - " partial_term 0.444812\n", - " stillbirth 0.019734\n", - "Nigeria anemia_screening_and_iv_iron_scaleup live_birth 0.529556\n", - " partial_term 0.448566\n", - " stillbirth 0.021878\n", - " baseline live_birth 0.529556\n", - " partial_term 0.448566\n", - " stillbirth 0.021878\n", - "Pakistan anemia_screening_and_iv_iron_scaleup live_birth 0.861148\n", - " partial_term 0.085616\n", - " stillbirth 0.053235\n", - " baseline live_birth 0.861148\n", - " partial_term 0.085616\n", - " stillbirth 0.053235\n", - "Name: value, dtype: float64" - ] - }, - "execution_count": 46, - "metadata": {}, - "output_type": "execute_result" - } - ], + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], "source": [ "scenario_pregnancy_outcome_proportions = (\n", " anc.groupby(cols + ['scenario', 'pregnancy_outcome'])['value'].sum()\n", @@ -3391,31 +2244,19 @@ }, { "cell_type": "code", - "execution_count": 47, + "execution_count": null, "id": "066352d7", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "location pregnancy_outcome scenario \n", - "Ethiopia live_birth anemia_screening_and_iv_iron_scaleup 1.0\n", - " partial_term anemia_screening_and_iv_iron_scaleup 1.0\n", - " stillbirth anemia_screening_and_iv_iron_scaleup 1.0\n", - "Nigeria live_birth anemia_screening_and_iv_iron_scaleup 1.0\n", - " partial_term anemia_screening_and_iv_iron_scaleup 1.0\n", - " stillbirth anemia_screening_and_iv_iron_scaleup 1.0\n", - "Pakistan live_birth anemia_screening_and_iv_iron_scaleup 1.0\n", - " partial_term anemia_screening_and_iv_iron_scaleup 1.0\n", - " stillbirth anemia_screening_and_iv_iron_scaleup 1.0\n", - "Name: value, dtype: float64" - ] - }, - "execution_count": 47, - "metadata": {}, - "output_type": "execute_result" - } - ], + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], "source": [ "cross_scenario_comparison = (\n", " scenario_pregnancy_outcome_proportions[scenario_pregnancy_outcome_proportions.index.get_level_values('scenario') != 'baseline'] /\n", @@ -3427,7 +2268,16 @@ { "cell_type": "markdown", "id": "b70c03a7", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: Pregnancy outcomes are the same between scenarios, except those that change MMS.\n", "\n", @@ -3437,7 +2287,16 @@ { "cell_type": "markdown", "id": "59f7e8fa", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: Prevalence of abortion/miscarriage/ectopic pregnancy outcomes are the same between scenarios.\n", "\n", @@ -3446,9 +2305,18 @@ }, { "cell_type": "code", - "execution_count": 48, + "execution_count": null, "id": "1c2d7f0b", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "outputs": [], "source": [ "assert (cross_scenario_comparison[cross_scenario_comparison.index.get_level_values('scenario') != 'mms_total_scaleup'] == 1).all(), \"non-MMS scenario changing pregnancy outcomes\"\n", @@ -3458,7 +2326,16 @@ { "cell_type": "markdown", "id": "2ebf17bd", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: Stillbirth less common in MMS scaleup scenario, by amount matching documented target.\n", "\n", @@ -3467,9 +2344,18 @@ }, { "cell_type": "code", - "execution_count": 49, + "execution_count": null, "id": "69839d15", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "outputs": [], "source": [ "if 'mms_total_scaleup' in scenarios_run:\n", @@ -3489,7 +2375,16 @@ { "cell_type": "markdown", "id": "d6082307", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: Observed RR of IFA on preterm birth approximately matches documented target, comparing *simulants* within the baseline scenario.\n", "\n", @@ -3498,86 +2393,19 @@ }, { "cell_type": "code", - "execution_count": 50, + "execution_count": null, "id": "b0ea3a27", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
ifa_coveragecountmeanstdmin2.5%50%97.5%max
0False30.01.0000000.0000001.0000001.0000001.0000001.000001.000000
1True30.00.8808890.0388380.8116650.8194510.8804550.955790.958084
\n", - "
" - ], - "text/plain": [ - " ifa_coverage count mean std min 2.5% 50% \\\n", - "0 False 30.0 1.000000 0.000000 1.000000 1.000000 1.000000 \n", - "1 True 30.0 0.880889 0.038838 0.811665 0.819451 0.880455 \n", - "\n", - " 97.5% max \n", - "0 1.00000 1.000000 \n", - "1 0.95579 0.958084 " - ] - }, - "execution_count": 50, - "metadata": {}, - "output_type": "execute_result" - } - ], + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], "source": [ "# check IFA on PTB relative to no treatment\n", " # filter to single ANC category to control for confounding by ANC in the IFA->PTB effect\n", @@ -3600,104 +2428,19 @@ }, { "cell_type": "code", - "execution_count": 51, + "execution_count": null, "id": "6ece2c13-030e-4088-8a84-1f4dfcf486f9", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
ifa_coveragelocationcountmeanstdmin2.5%50%97.5%max
0TrueEthiopia10.00.8758620.0434670.8224050.8224200.8829590.9465500.958084
1TrueNigeria10.00.8797060.0430340.8116650.8146570.8857850.9408830.949723
2TruePakistan10.00.8870990.0323510.8531570.8541220.8756410.9454070.954920
\n", - "
" - ], - "text/plain": [ - " ifa_coverage location count mean std min 2.5% \\\n", - "0 True Ethiopia 10.0 0.875862 0.043467 0.822405 0.822420 \n", - "1 True Nigeria 10.0 0.879706 0.043034 0.811665 0.814657 \n", - "2 True Pakistan 10.0 0.887099 0.032351 0.853157 0.854122 \n", - "\n", - " 50% 97.5% max \n", - "0 0.882959 0.946550 0.958084 \n", - "1 0.885785 0.940883 0.949723 \n", - "2 0.875641 0.945407 0.954920 " - ] - }, - "execution_count": 51, - "metadata": {}, - "output_type": "execute_result" - } - ], + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], "source": [ "# let's check by location\n", "rr.loc[rr.ifa_coverage].groupby(['ifa_coverage','location'])['value'].describe(percentiles=[0.025,0.975]).reset_index()\n", @@ -3709,108 +2452,37 @@ { "cell_type": "markdown", "id": "ac0a33aa", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: Observed RR of MMS (vs IFA) on preterm birth approximately matches documented target, comparing *simulants* across all scenarios.\n", - "\n", - "Type: manual (not easy to fuzzy check because there is stochastic uncertainty on both). We should really check this between scenarios, fuzzily, with CRN." - ] - }, - { - "cell_type": "code", - "execution_count": 52, - "id": "857d11ef", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
oral_iron_coveragelocationcountmeanstdmin2.5%50%97.5%max
3mmsEthiopia0.0NaNNaNNaNNaNNaNNaNNaN
4mmsNigeria0.0NaNNaNNaNNaNNaNNaNNaN
5mmsPakistan0.0NaNNaNNaNNaNNaNNaNNaN
\n", - "
" - ], - "text/plain": [ - " oral_iron_coverage location count mean std min 2.5% 50% 97.5% max\n", - "3 mms Ethiopia 0.0 NaN NaN NaN NaN NaN NaN NaN\n", - "4 mms Nigeria 0.0 NaN NaN NaN NaN NaN NaN NaN\n", - "5 mms Pakistan 0.0 NaN NaN NaN NaN NaN NaN NaN" - ] - }, - "execution_count": 52, - "metadata": {}, - "output_type": "execute_result" - } - ], + "\n", + "Type: manual (not easy to fuzzy check because there is stochastic uncertainty on both). We should really check this between scenarios, fuzzily, with CRN." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "857d11ef", + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], "source": [ "# now check MMS on PTB relative to IFA\n", "\n", @@ -3830,31 +2502,19 @@ }, { "cell_type": "code", - "execution_count": 53, + "execution_count": null, "id": "a8a7b14d-b27c-4394-9911-ab92d771e399", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "location oral_iron_coverage\n", - "Ethiopia ifa 0.103302\n", - " mms 0.000000\n", - " none 0.202371\n", - "Nigeria ifa 0.232548\n", - " mms 0.000000\n", - " none 0.424027\n", - "Pakistan ifa 0.196759\n", - " mms 0.000000\n", - " none 0.364844\n", - "Name: value, dtype: float64" - ] - }, - "execution_count": 53, - "metadata": {}, - "output_type": "execute_result" - } - ], + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], "source": [ "# ok now let's check hemoglobin exposure by scenario\n", "\n", @@ -3870,7 +2530,16 @@ { "cell_type": "markdown", "id": "d9f48735", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: Proportion of simulants with low hemoglobin (<100) is lower when they receive IFA or MMS than nothing.\n", "\n", @@ -3879,9 +2548,18 @@ }, { "cell_type": "code", - "execution_count": 54, + "execution_count": null, "id": "7b7a1c2c", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "outputs": [], "source": [ "# we don't have an expected verification target here... \n", @@ -3893,9 +2571,18 @@ }, { "cell_type": "code", - "execution_count": 55, + "execution_count": null, "id": "0879fcf8-743e-49f7-a5c8-ddb4bf7fb08a", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "outputs": [], "source": [ "# ok so let's also do a quick check that neonatal deaths are lower by scenario too" @@ -3903,179 +2590,19 @@ }, { "cell_type": "code", - "execution_count": 56, + "execution_count": null, "id": "7bf12f07-0d9d-4d2b-81b5-0af97e13f1bb", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
acs_availabilityacs_eligibilityantibiotics_availabilitychild_age_groupchild_sexcpap_availabilitydelivery_facility_typeneonatal_burden_observer_cause_of_deathpreterm_birthprobiotics_availabilityscenarioinput_drawlocationvalue
0FalseFalseFalseearly_neonatalFemaleFalseBEmONCneonatal_encephalopathy_due_to_birth_asphyxia_...FalseFalseanemia_screening_and_iv_iron_scaleup22Pakistan211.0
1FalseFalseFalseearly_neonatalFemaleFalseBEmONCneonatal_encephalopathy_due_to_birth_asphyxia_...FalseFalseanemia_screening_and_iv_iron_scaleup60Pakistan232.0
2FalseFalseFalseearly_neonatalFemaleFalseBEmONCneonatal_encephalopathy_due_to_birth_asphyxia_...FalseFalseanemia_screening_and_iv_iron_scaleup71Pakistan229.0
3FalseFalseFalseearly_neonatalFemaleFalseBEmONCneonatal_encephalopathy_due_to_birth_asphyxia_...FalseFalseanemia_screening_and_iv_iron_scaleup79Pakistan213.0
4FalseFalseFalseearly_neonatalFemaleFalseBEmONCneonatal_encephalopathy_due_to_birth_asphyxia_...FalseFalseanemia_screening_and_iv_iron_scaleup115Pakistan160.0
\n", - "
" - ], - "text/plain": [ - " acs_availability acs_eligibility antibiotics_availability \\\n", - "0 False False False \n", - "1 False False False \n", - "2 False False False \n", - "3 False False False \n", - "4 False False False \n", - "\n", - " child_age_group child_sex cpap_availability delivery_facility_type \\\n", - "0 early_neonatal Female False BEmONC \n", - "1 early_neonatal Female False BEmONC \n", - "2 early_neonatal Female False BEmONC \n", - "3 early_neonatal Female False BEmONC \n", - "4 early_neonatal Female False BEmONC \n", - "\n", - " neonatal_burden_observer_cause_of_death preterm_birth \\\n", - "0 neonatal_encephalopathy_due_to_birth_asphyxia_... False \n", - "1 neonatal_encephalopathy_due_to_birth_asphyxia_... False \n", - "2 neonatal_encephalopathy_due_to_birth_asphyxia_... False \n", - "3 neonatal_encephalopathy_due_to_birth_asphyxia_... False \n", - "4 neonatal_encephalopathy_due_to_birth_asphyxia_... False \n", - "\n", - " probiotics_availability scenario input_draw \\\n", - "0 False anemia_screening_and_iv_iron_scaleup 22 \n", - "1 False anemia_screening_and_iv_iron_scaleup 60 \n", - "2 False anemia_screening_and_iv_iron_scaleup 71 \n", - "3 False anemia_screening_and_iv_iron_scaleup 79 \n", - "4 False anemia_screening_and_iv_iron_scaleup 115 \n", - "\n", - " location value \n", - "0 Pakistan 211.0 \n", - "1 Pakistan 232.0 \n", - "2 Pakistan 229.0 \n", - "3 Pakistan 213.0 \n", - "4 Pakistan 160.0 " - ] - }, - "execution_count": 56, - "metadata": {}, - "output_type": "execute_result" - } - ], + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], "source": [ "nn_deaths = read_results('neonatal_burden_observer_disorder_deaths', baseline_only=False)\n", "nn_deaths.head()" @@ -4084,7 +2611,16 @@ { "cell_type": "markdown", "id": "7f95aa08", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: Fewer neonatal deaths in MMS scale up scenario(s).\n", "\n", @@ -4093,9 +2629,18 @@ }, { "cell_type": "code", - "execution_count": 57, + "execution_count": null, "id": "0f8ae0b1", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "outputs": [], "source": [ "if 'mms_total_scaleup' in scenarios_run:\n", @@ -4103,152 +2648,23 @@ " nn_deaths[nn_deaths.scenario == 'baseline']['value'].sum() >\n", " nn_deaths[nn_deaths.scenario == 'mms_total_scaleup']['value'].sum()\n", " ), \"neonatal deaths not lower in MMS scenario\"" - ] - }, - { - "cell_type": "code", - "execution_count": 58, - "id": "f1611133-6afc-4734-9e32-dcd16990d08b", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
age_groupazithromycin_availabilitydelivery_facility_typematernal_disorders_burden_observer_cause_of_deathmisoprostol_availabilitypregnancy_outcomescenarioinput_drawlocationvalue
010_to_14FalseBEmONCabortion_miscarriage_ectopic_pregnancyFalselive_birthanemia_screening_and_iv_iron_scaleup22Pakistan0.0
110_to_14FalseBEmONCabortion_miscarriage_ectopic_pregnancyFalselive_birthanemia_screening_and_iv_iron_scaleup60Pakistan0.0
210_to_14FalseBEmONCabortion_miscarriage_ectopic_pregnancyFalselive_birthanemia_screening_and_iv_iron_scaleup71Pakistan0.0
310_to_14FalseBEmONCabortion_miscarriage_ectopic_pregnancyFalselive_birthanemia_screening_and_iv_iron_scaleup79Pakistan0.0
410_to_14FalseBEmONCabortion_miscarriage_ectopic_pregnancyFalselive_birthanemia_screening_and_iv_iron_scaleup115Pakistan0.0
\n", - "
" - ], - "text/plain": [ - " age_group azithromycin_availability delivery_facility_type \\\n", - "0 10_to_14 False BEmONC \n", - "1 10_to_14 False BEmONC \n", - "2 10_to_14 False BEmONC \n", - "3 10_to_14 False BEmONC \n", - "4 10_to_14 False BEmONC \n", - "\n", - " maternal_disorders_burden_observer_cause_of_death misoprostol_availability \\\n", - "0 abortion_miscarriage_ectopic_pregnancy False \n", - "1 abortion_miscarriage_ectopic_pregnancy False \n", - "2 abortion_miscarriage_ectopic_pregnancy False \n", - "3 abortion_miscarriage_ectopic_pregnancy False \n", - "4 abortion_miscarriage_ectopic_pregnancy False \n", - "\n", - " pregnancy_outcome scenario input_draw \\\n", - "0 live_birth anemia_screening_and_iv_iron_scaleup 22 \n", - "1 live_birth anemia_screening_and_iv_iron_scaleup 60 \n", - "2 live_birth anemia_screening_and_iv_iron_scaleup 71 \n", - "3 live_birth anemia_screening_and_iv_iron_scaleup 79 \n", - "4 live_birth anemia_screening_and_iv_iron_scaleup 115 \n", - "\n", - " location value \n", - "0 Pakistan 0.0 \n", - "1 Pakistan 0.0 \n", - "2 Pakistan 0.0 \n", - "3 Pakistan 0.0 \n", - "4 Pakistan 0.0 " - ] - }, - "execution_count": 58, - "metadata": {}, - "output_type": "execute_result" - } - ], + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f1611133-6afc-4734-9e32-dcd16990d08b", + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], "source": [ "deaths = read_results('maternal_disorders_burden_observer_disorder_deaths', baseline_only=False)\n", "deaths.head()" @@ -4256,28 +2672,19 @@ }, { "cell_type": "code", - "execution_count": 59, + "execution_count": null, "id": "8fd1237b-10c6-49ca-ba8a-3de185280dfc", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "location scenario \n", - "Ethiopia anemia_screening_and_iv_iron_scaleup 156.60\n", - " baseline 158.85\n", - "Nigeria anemia_screening_and_iv_iron_scaleup 183.85\n", - " baseline 192.95\n", - "Pakistan anemia_screening_and_iv_iron_scaleup 137.95\n", - " baseline 142.70\n", - "Name: value, dtype: float64" - ] - }, - "execution_count": 59, - "metadata": {}, - "output_type": "execute_result" - } - ], + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], "source": [ "mmr = (deaths.groupby(['location','scenario','input_draw'])['value'].sum()\n", " / anc.groupby(['location','scenario','input_draw'])['value'].sum()) * 100_000\n", @@ -4289,25 +2696,19 @@ }, { "cell_type": "code", - "execution_count": 60, + "execution_count": null, "id": "d7d93c10", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "location scenario\n", - "Ethiopia baseline 158.85\n", - "Nigeria baseline 192.95\n", - "Pakistan baseline 142.70\n", - "Name: value, dtype: float64" - ] - }, - "execution_count": 60, - "metadata": {}, - "output_type": "execute_result" - } - ], + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], "source": [ "mmr[mmr.index.get_level_values('scenario').isin(['baseline', 'mms_total_scaleup'])]" ] @@ -4315,7 +2716,16 @@ { "cell_type": "markdown", "id": "69ad7b84", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: Fewer maternal deaths in MMS scale up scenario(s).\n", "\n", @@ -4328,9 +2738,18 @@ }, { "cell_type": "code", - "execution_count": 61, + "execution_count": null, "id": "63e79e19", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "outputs": [], "source": [ "if 'mms_total_scaleup' in scenarios_run:\n", @@ -4341,9 +2760,18 @@ }, { "cell_type": "code", - "execution_count": 62, + "execution_count": null, "id": "f4a33d26-12de-4b2c-9e58-392893346bf6", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "outputs": [], "source": [ "# check incidence too (better sample size)" @@ -4351,135 +2779,19 @@ }, { "cell_type": "code", - "execution_count": 63, + "execution_count": null, "id": "be57b58f-da64-4f74-ac60-e779b9f42335", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
age_groupazithromycin_availabilitydelivery_facility_typemisoprostol_availabilitypregnancy_outcomescenarioinput_drawlocationvalue
010_to_14FalseBEmONCFalselive_birthanemia_screening_and_iv_iron_scaleup22Pakistan37.0
110_to_14FalseBEmONCFalselive_birthanemia_screening_and_iv_iron_scaleup60Pakistan18.0
210_to_14FalseBEmONCFalselive_birthanemia_screening_and_iv_iron_scaleup71Pakistan8.0
310_to_14FalseBEmONCFalselive_birthanemia_screening_and_iv_iron_scaleup79Pakistan16.0
410_to_14FalseBEmONCFalselive_birthanemia_screening_and_iv_iron_scaleup115Pakistan14.0
\n", - "
" - ], - "text/plain": [ - " age_group azithromycin_availability delivery_facility_type \\\n", - "0 10_to_14 False BEmONC \n", - "1 10_to_14 False BEmONC \n", - "2 10_to_14 False BEmONC \n", - "3 10_to_14 False BEmONC \n", - "4 10_to_14 False BEmONC \n", - "\n", - " misoprostol_availability pregnancy_outcome \\\n", - "0 False live_birth \n", - "1 False live_birth \n", - "2 False live_birth \n", - "3 False live_birth \n", - "4 False live_birth \n", - "\n", - " scenario input_draw location value \n", - "0 anemia_screening_and_iv_iron_scaleup 22 Pakistan 37.0 \n", - "1 anemia_screening_and_iv_iron_scaleup 60 Pakistan 18.0 \n", - "2 anemia_screening_and_iv_iron_scaleup 71 Pakistan 8.0 \n", - "3 anemia_screening_and_iv_iron_scaleup 79 Pakistan 16.0 \n", - "4 anemia_screening_and_iv_iron_scaleup 115 Pakistan 14.0 " - ] - }, - "execution_count": 63, - "metadata": {}, - "output_type": "execute_result" - } - ], + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], "source": [ "inc = read_results('maternal_hemorrhage_counts', baseline_only=False)\n", "inc.head()" @@ -4487,28 +2799,19 @@ }, { "cell_type": "code", - "execution_count": 64, + "execution_count": null, "id": "e0c560e0-4e1d-49e8-a425-d5b5f86b9a2f", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "location scenario \n", - "Ethiopia anemia_screening_and_iv_iron_scaleup 232389.0\n", - " baseline 246938.0\n", - "Nigeria anemia_screening_and_iv_iron_scaleup 74724.0\n", - " baseline 82274.0\n", - "Pakistan anemia_screening_and_iv_iron_scaleup 79799.0\n", - " baseline 92540.0\n", - "Name: value, dtype: float64" - ] - }, - "execution_count": 64, - "metadata": {}, - "output_type": "execute_result" - } - ], + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], "source": [ "inc = inc.groupby(['location', 'scenario'])['value'].sum()\n", "inc" @@ -4517,7 +2820,16 @@ { "cell_type": "markdown", "id": "66aa347b", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: Fewer incident maternal hemorrhage cases in MMS scale up scenario(s).\n", "\n", @@ -4530,9 +2842,18 @@ }, { "cell_type": "code", - "execution_count": 65, + "execution_count": null, "id": "cf259742", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "outputs": [], "source": [ "if 'mms_total_scaleup' in scenarios_run:\n", @@ -4544,7 +2865,16 @@ { "cell_type": "markdown", "id": "3687a2dd", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "### IV iron" ] @@ -4552,7 +2882,16 @@ { "cell_type": "markdown", "id": "670f1662", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: IV iron only received by simulants who tested low ferritin.\n", "\n", @@ -4561,9 +2900,18 @@ }, { "cell_type": "code", - "execution_count": 66, + "execution_count": null, "id": "2bd6e38f", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "outputs": [], "source": [ "# https://vivarium-research.readthedocs.io/en/latest/models/intervention_models/mncnh_pregnancy/iv_iron_antenatal/iv_iron_mncnh.html#intervention-overview\n", @@ -4575,23 +2923,19 @@ }, { "cell_type": "code", - "execution_count": 67, + "execution_count": null, "id": "2d8903f8-0a20-43b0-95f1-45febd3e52cc", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "scenario\n", - "anemia_screening_and_iv_iron_scaleup 1.0\n", - "Name: value, dtype: float64" - ] - }, - "execution_count": 67, - "metadata": {}, - "output_type": "execute_result" - } - ], + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], "source": [ "iv_iron_coverage_by_scenario = (\n", " anc[anc.iv_iron_coverage == 'covered'].groupby(['scenario'])['value'].sum()\n", @@ -4604,7 +2948,16 @@ { "cell_type": "markdown", "id": "697bff0a", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: IV iron only received in IV iron scale up scenario(s).\n", "\n", @@ -4613,9 +2966,18 @@ }, { "cell_type": "code", - "execution_count": 68, + "execution_count": null, "id": "221daafb", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "outputs": [], "source": [ "assert (iv_iron_coverage_by_scenario[iv_iron_coverage_by_scenario.index.get_level_values('scenario') != 'anemia_screening_and_iv_iron_scaleup'] == 0).all(), \"IV iron scaled up in non-IV iron scenarios\"" @@ -4624,7 +2986,16 @@ { "cell_type": "markdown", "id": "36905fcb", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: IV iron received by all simulants with tested low ferritin in IV iron scale up scenario(s).\n", "\n", @@ -4633,9 +3004,18 @@ }, { "cell_type": "code", - "execution_count": 69, + "execution_count": null, "id": "3a973651", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "outputs": [], "source": [ "if 'anemia_screening_and_iv_iron_scaleup' in scenarios_run:\n", @@ -4644,28 +3024,19 @@ }, { "cell_type": "code", - "execution_count": 70, + "execution_count": null, "id": "a3a90b12", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "location scenario \n", - "Ethiopia anemia_screening_and_iv_iron_scaleup 156.60\n", - " baseline 158.85\n", - "Nigeria anemia_screening_and_iv_iron_scaleup 183.85\n", - " baseline 192.95\n", - "Pakistan anemia_screening_and_iv_iron_scaleup 137.95\n", - " baseline 142.70\n", - "Name: value, dtype: float64" - ] - }, - "execution_count": 70, - "metadata": {}, - "output_type": "execute_result" - } - ], + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], "source": [ "mmr[mmr.index.get_level_values('scenario').isin(['baseline', 'anemia_screening_and_iv_iron_scaleup'])]" ] @@ -4673,7 +3044,16 @@ { "cell_type": "markdown", "id": "3d2182d9", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: Fewer maternal deaths in IV iron scale up scenario(s).\n", "\n", @@ -4682,9 +3062,18 @@ }, { "cell_type": "code", - "execution_count": 71, + "execution_count": null, "id": "debff92e", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "outputs": [], "source": [ "if 'anemia_screening_and_iv_iron_scaleup' in scenarios_run:\n", @@ -4693,9 +3082,18 @@ }, { "cell_type": "code", - "execution_count": 72, + "execution_count": null, "id": "36cba3c5", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "outputs": [], "source": [ "# check incidence too (better sample size)" @@ -4704,7 +3102,16 @@ { "cell_type": "markdown", "id": "d1da513f", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "source": [ "CHECK: Fewer incident maternal hemorrhage cases in IV iron scale up scenario(s).\n", "\n", @@ -4713,9 +3120,18 @@ }, { "cell_type": "code", - "execution_count": 73, + "execution_count": null, "id": "ac928bb6", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "outputs": [], "source": [ "if 'anemia_screening_and_iv_iron_scaleup' in scenarios_run:\n", @@ -4724,9 +3140,18 @@ }, { "cell_type": "code", - "execution_count": 74, + "execution_count": null, "id": "cbdd005c", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "outputs": [], "source": [ "# NOTE: In future models IV iron will affect BW and GA so this won't be true\n", @@ -4741,9 +3166,18 @@ }, { "cell_type": "code", - "execution_count": 75, + "execution_count": null, "id": "14dcab26", - "metadata": {}, + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, "outputs": [], "source": [ "# also need to check stillbirth when that is implemented" @@ -4767,8 +3201,22 @@ "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.14" + }, + "papermill": { + "default_parameters": {}, + "duration": 69.891036, + "end_time": "2026-02-19T18:45:51.997948", + "environment_variables": {}, + "exception": true, + "input_path": "/mnt/share/homes/tylerdy/vivarium_gates_mncnh/tests/model_notebooks/results/model_26.0_anemic_screening.ipynb", + "output_path": "/mnt/share/homes/tylerdy/vivarium_gates_mncnh/tests/model_notebooks/results/model_26.0_anemic_screening.ipynb", + "parameters": { + "model_dir": "model29.1" + }, + "start_time": "2026-02-19T18:44:42.106912", + "version": "2.6.0" } }, "nbformat": 4, "nbformat_minor": 5 -} +} \ No newline at end of file