Analysis code for rural and wealth-related inequality in malaria-anemia co-infection among children under five in Tanzania (TDHS-MIS 2022).
# Rural and wealth-related inequality in malaria-anemia co-infection among children under five in Tanzania
Analysis code for the Acta Tropica manuscript of the same title. The scripts build a biomarker-complete cohort of children aged 6-59 months from the 2022 Tanzania Demographic and Health Survey and Malaria Indicator Survey (TDHS-MIS 2022) and reproduce Tables 1-4.
This repository does not contain DHS microdata.
## Requirements
- Python 3.11 or later (the manuscript was run on Python 3.14.4)
- pandas 2.3.3, NumPy 2.4.4, SciPy 1.17.1, svy 0.24.1
- TDHS-MIS 2022 recode files in RDS format, obtained from The DHS Program after a registered request
```text
data/dhs/TZKR82FL.rds
data/dhs/TZPR82FL.rds
data/dhs/TZHR82FL.rds
```
Do not commit or upload those files. The DHS terms of use forbid redistribution of micro-level data.
## Install
```bash
python -m pip install -r requirements.txt
```
## Run
```bash
python scripts/run_all.py
```
`01_build_cohort.py` links the KR, PR, and HR recodes, restricts to ages 6-59 months with both a malaria RDT and a hemoglobin result, and writes `derived/cohort_2022.parquet`. `03_analyze.py` estimates survey-weighted prevalences, Wagstaff concentration indices, and modified Poisson prevalence ratios, then writes `tables/`.
## Outputs
| File | Manuscript table |
| --- | --- |
| `tables/table1_characteristics_2022.csv` | Table 1 |
| `tables/table2_outcomes_by_wealth_2022.csv` | Table 2 |
| `tables/table3_wealth_prs_2022.csv` | Table 3 |
| `tables/table4_susceptibility_2022.csv` | Table 4 |
Expected analytic sample: 4,280 children (3,124 rural; 1,156 urban).
## Citation
Msemakweli JG, Mohamed H, Mapande I. Rural and wealth-related inequality in malaria-anemia co-infection among children under five in Tanzania. Manuscript submitted to Acta Tropica.
If you use the code, cite this archive:
Msemakweli JG, Mohamed H, Mapande I. Analysis code for rural and wealth-related inequality in malaria-anemia co-infection among children und …