# Perinatal Mortality in Northern Ghana — Analysis Code
Reproducible analysis for:
> **Prevalence and Demographic Characteristics of Stillbirths and Perinatal Deaths:
> A Five-Year Retrospective Study at a Regional Hospital in Northern Ghana**
> (Ngman-Wara GM, Quist ED, Abdul-Rahaman L — manuscript in preparation)
This repository contains the complete, scripted data-cleaning and analysis pipeline
used to produce every number, table and figure reported in the manuscript.
## What the analysis does
Using de-identified routine hospital records from the Lightwave Health Information
Management System (LHIMS) of the Upper West Regional Hospital, Wa, Ghana
(1 January 2021 – 31 December 2025), the script:
1. **Loads and harmonises** three source workbooks (stillbirth register,
neonatal mortality log, 2022 register line-list update, annual delivery totals),
including parsing of free-text values ("41 WEEKS", "3.1KG", "Above 5"),
standardising misspelled entries, and de-duplication.
2. **Answers the study's four research questions**:
- Q1 — five-year prevalence and trends of stillbirth, early neonatal and
perinatal mortality (rates per 1,000 with exact Poisson 95% CIs,
chi-square homogeneity tests, delivery-weighted linear trend tests);
- Q2 — maternal demographic characteristics of affected mothers
(case–case comparison: stillbirths vs early neonatal deaths);
- Q3 — obstetric and clinical factors, including a multivariable logistic
regression contrasting fresh (intrapartum proxy) with macerated
(antepartum proxy) stillbirths;
- Q4 — antepartum vs intrapartum classification and a full documentation-gap
audit (missingness, biological plausibility of gestational age–birth weight
pairs, data-quality flags).
3. **Writes all outputs** (CSV tables and PNG figures) to `analysis_output/` and a
full console report to `run_log.txt`.
4. **Reports explicitly which study questions cannot be answered** with the
available data (e.g., no live-birth co …