Analysis code for a Blinder–Oaxaca-type decomposition of rural–urban and wealth-related inequalities in health facility delivery in Tanzania using the 2022 TDHS-MIS. Python (pandas, numpy, matplotlib). Dataset not included; available from the DHS Program.
# Decomposing wealth and residential inequalities in facility delivery in Tanzania
Analysis code for a Blinder–Oaxaca-type decomposition of rural–urban and wealth-related
inequalities in health facility delivery among women in Tanzania, using the
2022 Tanzania Demographic and Health Survey and Malaria Indicator Survey (TDHS-MIS).
This repository contains the code that reproduces all descriptive estimates, the
rural–urban and richest–poorest decompositions, the wealth-by-residence interaction
analysis, and the sensitivity analysis reported in the manuscript.
---
## Study
- **Manuscript:** *Decomposing wealth and residential inequalities in facility delivery among women in Tanzania*
- **Author:** Clifford Silver Tarimo, Department of Science and Laboratory Technology, Dar es Salaam Institute of Technology, Tanzania
- **Data source:** 2022 TDHS-MIS, women's individual recode (`TZIR81FL.DTA`)
---
## Data availability
**The TDHS-MIS data are NOT included in this repository.** The DHS Program's terms of
use prohibit redistribution of the datasets. The data are freely available to
registered users from the DHS Program after a short application:
-
dhsprogram.com
Once approved, download the **Tanzania 2022** *Individual Recode* in Stata format
(`TZIR81FL.DTA`) and place it in the same folder as the notebook (or update the
`data_dir` path at the top of the notebook).
---
## Analytic approach
Facility delivery (delivery in a public, private, or religious/voluntary health
facility) was modelled with a **weighted linear probability model** estimated by
weighted least squares using the women's sampling weight. The rural–urban and
richest–poorest gaps were partitioned into an **explained (composition)** component
and an **unexplained** component using a regression-based **Blinder–Oaxaca-type
decomposition**:
- The explained component is E = Σ (x̄_A − x̄_B) · β̂, where x̄_A and x̄_B are the
weighted mean covariate values in the advantaged and disadvantag …