Reproducible analytical pipeline for data harmonisation and predictive modelling of stillbirths and neonatal deaths across seven contributing studies in Sub-Saharan Africa
# Predictive Modelling for Stillbirths and Neonatal Deaths in Sub-Saharan Africa
Reproducible analytical pipeline for data harmonisation and predictive modelling across seven contributing studies (ALERT, EN-INDEPTH, PTBi, PRECISE, WHOMCS, NCOPS, DHS). Implements a 13-domain harmonisation framework and classical, machine learning and AI modelling approaches. Associated with a Wellcome Accelerator Award at the London School of Hygiene and Tropical Medicine.
## Pipeline overview
The pipeline produces a unified analytical dataset (v10.17) from six prospective cohort studies and national DHS surveys across Sub-Saharan Africa, linked with geospatial environmental exposures. Scripts are numbered in execution order and should be run sequentially from the project root directory.
### Execution order
| Step | Script | Description |
|------|--------|-------------|
| 01 | `pipeline/01_unified_dataset_pipeline_v10.15.Rmd` | Load and harmonise six studies (NCOPS, ALERT, PRECISE, PTBi, EN-INDEPTH, WHOMCS) into the 13-domain variable schema. Outputs `unified_dataset_v10.15.rds`. |
| 02 | `pipeline/02_dhs_pipeline_v7.2.Rmd` | Download, process and harmonise DHS Birth Recode data for all SSA countries with incremental checkpointing. Merges DHS with the 6-study dataset to produce `merged_unified_dataset_v10.16.rds`. |
| 03 | `pipeline/03_fix_dhs_geographic_linkage.R` | Download DHS GE shapefiles and link cluster-level GPS coordinates (replacing country centroids). Updates `merged_unified_dataset_v10.16.rds` with real GPS. |
| 04 | `pipeline/04_fix_dhs_labels_attendant.R` | Restore religion, ethnicity and birth attendant labels from DHS raw BR files. Updates `merged_unified_dataset_v10.16.rds` in place. |
| 05 | `pipeline/05_integrated_environmental_pipeline_v3.3.Rmd` | Extract environmental exposures (elevation, ERA5 climate, PM2.5, seasonality) from raster data. Outputs `environmental_linkage_v3.3.rds`. |
| 06 | `pipeline/06_optimized_environmental_extraction_v3.4.R` | Optimised …