A Socio-Economic Peacebuilding Index (SEPI) for the Horn of Africa
# SEPI — Socio-Economic Peacebuilding Index
A composite indicator measuring relative socio-economic conditions relevant to peacebuilding across Admin-1 regions in **Kenya**, **Somalia**, and **South Sudan**.
## Quick Start
Open the project in RStudio (`SEPI_R&D.Rproj`) and source the relevant entry point. Required packages are installed automatically.
To run the full pipeline in one go:
```r
source("run_all.R")
```
---
## Pipeline Scripts
### `run_all.R` — Master pipeline runner
Runs all six scripts in sequence. Change `active_version` at the top to run the full pipeline for a different version. Scripts 05 and 06 always compare `v1_equal_geometric` against `v2_conflict_weighted` regardless of this setting.
---
### `01_build_data.R` — Rebuild the merged dataset
Run this when source CSVs, ACLED data, or remote sensing inputs have been updated. It merges all per-country source files into three shared assets consumed by the rest of the pipeline:
| Output | Description |
|--------|-------------|
| `data/sepi_indicators_all_countries_latest.csv` | Merged indicator data for all three countries |
| `data/sepi_indicators_metadata_all_countries.csv` | Indicator metadata (labels, directionality, sources) |
| `data/sepi_merge_qc_report.json` | QC report flagging merge issues |
You do not need to re-run this unless the underlying data changes.
#### ACLED credentials
ACLED data is fetched live from the API at runtime (2016–2025, all three countries). A `.env` file in the project root is required:
```
ACLED_EMAIL=your_email@example.com
ACLED_PASSWORD=your_acled_api_key
```
#### ACLED column naming
Conflict columns are produced with a yearly suffix for each year in the configured date range:
| Column | Description |
|--------|-------------|
| `total_fatalities_2025` | Total ACLED fatalities in 2025 per Admin-1 |
| `count_conflict_events_2025` | Total conflict events in 2025 per Admin-1 |
| `total_fatalities_per_1k_2025` | Fatalities per 1,000 population (2025) | …