Replication & Reproducibility¶
This archive is the data layer of a larger replication ecosystem: one book and three companion working papers all draw on the datasets catalogued here. This page explains where each piece lives, how the analyses are reproduced, and the status of the validation chain that underwrites them.
Citable archive
The datasets are released under CC-BY-4.0 with machine-readable metadata in CITATION.cff. A versioned snapshot with a permanent DOI will be deposited on Zenodo on publication of the book; until then, cite the GitHub repository (see Citation).
The four repositories¶
The project is split across four private/public Git repositories, each with its own GitHub remote. This archive is the shared data layer the other three read from.
| Repository | Contents | Role in replication |
|---|---|---|
sa-apartheid-economy-data (this site) |
Analysis-ready datasets, the provenance index, validation scripts, and this documentation | The data layer every analysis reads from |
apartheid-book |
The Cost of Apartheid manuscript, its analysis code, and the figure/table build scripts | Reproduces the book's figures, tables, and Data Appendix |
apartheid-labour-shock |
Boone & Wilse-Samson, Coalition Fracture Under Labor Scarcity (the 1974-shock paper) | Reproduces the agricultural and electoral results that anchor book Chapters 3, 4, and 9 |
strikes-apartheid-jpe |
Naidu, Turban & Wilse-Samson, Diffuse Pressure (strikes) and Sanctions, Dual Currency Systems, and the End of Apartheid | Reproduces the strike event-study (Ch 5) and the financial-rand / sanctions results (Ch 8) |
Each paper's repository carries its own replication/ package; this page is the map that ties them to the shared data.
What reproduces what¶
The book grades its empirical claims by evidence tier in its prefatory note. The two genuinely identified anchors, the robust descriptive trends, and the one prominently demoted result are:
| Result | Canonical value | Reads from | Specification |
|---|---|---|---|
| National wage shock | open×post = 0.018 (p = 0.47); national level shift +0.63 log points | Agricultural census panel | L1 (literature regressions) |
| Eiselen electoral divergence | East×1987 = +14.2pp right-wing (−26.85pp NP), N = 426 | Electoral panel + crosswalk | R10 exact-line event study (Figure A.2) |
| National mechanization | combines +30%, tractors +13%, regular Black employment −10% (1972–80) | Agricultural census panel | Descriptive trends |
| Combines open/closed DiD (demoted) | +0.017 (p = 0.84) under district + year fixed effects | Agricultural census panel | Two-way FE specification audit |
The full hierarchy lives in docs/canonical_estimates.md in the book repository, which is kept in sync with the companion paper. If a number on this site ever disagrees with the book, the book's Data Appendix is authoritative — please open an issue so we can resync.
Reproducing the analysis¶
Environment¶
- Python 3.12+ with
pandas,polars,numpy,statsmodels,linearmodels,matplotlib,plotnine - R 4.5+ with
tidyverse,fixest,sf,estimatr,here(used for several figures and spatial work) - pandoc + a TeX distribution (the book's combined manuscript builds via
xelatex)
Entry points¶
# 1. Build the analysis-ready panels from the catalogued data
# (panel builders live in shared_resources/scripts/panel_builders/)
python shared_resources/scripts/panel_builders/01_ag_census_panel.py
# 2. Reproduce the book's regressions, tables, and figures
cd apartheid-book
python analysis/literature_regressions.py # L1–L13 specifications
python analysis/counterfactual_projections.py # Ch 10 / Appendix D.1
python analysis/structural_breaks.py # Appendix D.0.2
python analysis/conley_electoral_se.py # Eiselen spatial-HAC SEs
python analysis/phase_j_additions_2026_04_20.py # 2026 reviewer-driven figures
# 3. Rebuild the combined manuscript (PDF/HTML/MD)
python scripts/build_combined_manuscript.py
The book repository's replication/MANIFEST.md maps every numbered table and figure to its producing script and input dataset.
The validation chain¶
Every datum traces from a published census page through digitization to the analysis-ready panel. The chain is documented in full on the Provenance & Validation page; in brief:
- Source → digitization. Original digitization by contract workers (2013–14), with later machine-vision re-extraction (Claude for the agricultural-census spot-checks; Gemini for the mining-financial and mine-wage series).
- Internal-consistency validation. District sums checked against published regional totals, year-on-year plausibility flags.
- Cross-panel reconciliation. The agricultural panel was reconciled cell-by-cell against Christopher Boone's independently cleaned version: 141,101 of 142,380 cells matched exactly (99.1%), with every discrepancy investigated against source PDFs.
- Corrections log. Every adjusted cell is recorded with its original value, corrected value, source of correction, and date.
A machine-readable PROVENANCE_INDEX.csv maps all 1,800+ analysis CSVs to their source Excel files and source PDFs.
DOI and versioning¶
There is no Zenodo DOI yet: the citation currently resolves to the GitHub repository, with GitHub as publisher. This is appropriate before publication, but it has one drawback — a moving HEAD can drift out from under a manuscript that points at it (the kind of drift that let an earlier electoral figure linger on this site after the book had moved on). Two commitments follow:
- The book's Data Availability statement promises a Zenodo DOI on publication — it will be minted then.
- Minting a versioned snapshot now is under consideration, so that the book and papers can cite a stable, frozen identifier rather than a moving target.
Until then, please cite the repository URL and the commit hash you used.