# USAID cuts — replication package

Data and code to reproduce four figures on USAID FY2024 → FY2025 spending
cuts and the PEPFAR ART coverage disruption:

1. `output/usaid_sector_slopegraph.html`
   Tufte-style slopegraph (log scale, interactive toggle between
   obligations and disbursements) of USAID spending by sector.
2. `output/usaid_country_cuts_map.html`
   World map, colored by % cut at the country level (toggle obligations
   / disbursements, hover for detail).
3. `output/usaid_sector_predicted_vs_actual.html`
   Scatter plot of predicted vs actual dollar cut by sector, one point
   per USG Sector Program Area.
4. `output/spending_vs_coverage_side_by_side.png`
   Paired within-fiscal-year charts: USAID HIV/AIDS disbursements (left)
   and PEPFAR ART recipients (right), each anchored at prior Q4 = 0,
   FY2025 highlighted.

## Directory layout

```
replication-package/
├── README.md                 (this file)
├── CGD_STYLE.md              (visual-design notes used by the figures)
├── requirements.txt          (Python deps)
│
├── data/                     (input datasets)
│   ├── usaidcuts - sector.csv
│   ├── usaidcuts - country.csv
│   ├── Kenny-Millions-Lost-Access-PEPFAR-Data.xlsx
│   └── fa_gov_complete/
│       └── README.md         (instructions to download the 3.75 GB FA.gov file)
│
├── code/                     (reproduction scripts)
│   ├── aggregate_usaid_sector_series.py
│   ├── build_country_fy24_fy25.py
│   ├── inline_sector_data.py
│   ├── inline_country_map_data.py
│   └── plot_spending_vs_coverage_side_by_side.py
│
└── output/                   (generated figures + intermediate data)
    ├── usaid_sector_slopegraph.html
    ├── usaid_country_cuts_map.html
    ├── usaid_sector_predicted_vs_actual.html
    ├── spending_vs_coverage_side_by_side.png
    ├── usaid_sector_series_quarterly_2015_2025.csv
    └── usaid_country_fy24_fy25.json
```

## Data sources

| File | Source | Role |
|------|--------|------|
| `data/usaidcuts - sector.csv` | Kenny & Sandefur (CGD) from foreignassistance.gov | Sector-level FY24 and FY25 totals + SK prediction column. Inlined into the two sector HTML figures. |
| `data/usaidcuts - country.csv` | Kenny & Sandefur (CGD) from foreignassistance.gov | Country-level FY24 and FY25 totals for the 31 largest USAID recipient countries. Included for reference; not directly used by the current figures (the country map uses a wider dataset from the bulk FA.gov file). |
| `data/Kenny-Millions-Lost-Access-PEPFAR-Data.xlsx` | Kenny (CGD), originally from PEPFAR Panorama | Quarterly PEPFAR indicator data 2019Q1-2025Q4, 58 countries, 46 indicators. We use only `TX_CURR` (ART recipients). |
| `data/fa_gov_complete/us_foreign_aid_complete.csv` | foreignassistance.gov (DevTech Systems) | 3.75 GB bulk transaction file. Not bundled; see `data/fa_gov_complete/README.md` for a download URL. Required to regenerate `output/usaid_sector_series_quarterly_2015_2025.csv` and `output/usaid_country_fy24_fy25.json`. |

## Dependency graph

```
usaidcuts - sector.csv ──▶ inline_sector_data.py ──▶ usaid_sector_slopegraph.html
                                                   └▶ usaid_sector_predicted_vs_actual.html

us_foreign_aid_complete.csv ──▶ build_country_fy24_fy25.py ──▶ usaid_country_fy24_fy25.json
                                                              ─(inline_country_map_data.py)─▶ usaid_country_cuts_map.html

us_foreign_aid_complete.csv ──▶ aggregate_usaid_sector_series.py ──▶ usaid_sector_series_quarterly_2015_2025.csv
                                                                            +
Kenny-Millions-...-PEPFAR-Data.xlsx ──────────────────────────┐
                                                              ▼
                                              plot_spending_vs_coverage_side_by_side.py
                                                              │
                                                              ▼
                                            spending_vs_coverage_side_by_side.png
```

## How to reproduce

### 0. Setup

```
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
```

Python 3.9 or later; tested on 3.11.

### 1. (Optional, takes 30 seconds if you already have the file locally)
### Reproduce the two HTML sector figures from the sector CSV

```
python code/inline_sector_data.py
```

This reads `data/usaidcuts - sector.csv` and rewrites the inline `const DATA`
JavaScript literal inside `output/usaid_sector_slopegraph.html` and
`output/usaid_sector_predicted_vs_actual.html`. The shipped HTML files already
contain the correct data; run this only if you want to verify the round-trip
from the CSV to the HTML, or if you edit the CSV.

### 2. Reproduce the country map

Requires the 3.75 GB FA.gov bulk file. See `data/fa_gov_complete/README.md`
for download instructions.

```
# Regenerate the JSON payload
python code/build_country_fy24_fy25.py

# Patch it into the HTML
python code/inline_country_map_data.py
```

### 3. Reproduce the paired spending/coverage PNG

Also requires the bulk FA.gov file.

```
# (a) Rebuild the quarterly spending series
python code/aggregate_usaid_sector_series.py

# (b) Draw the figure
python code/plot_spending_vs_coverage_side_by_side.py
```

Step (a) additionally produces two sibling CSVs that the figure doesn't use
but that are useful for follow-on work:
- `output/usaid_sector_series_2015_2025.csv` — annual version
- `output/all_foreign_assistance_sector_series_quarterly_2015_2025.csv` —
  quarterly, not filtered to USAID.

## Methodology notes

### Scope

All USAID-only figures filter the FA.gov bulk file on
`Managing Agency Acronym = "USAID"`. This reproduces the FY24 and FY25
totals in `usaidcuts - sector.csv` exactly:

|                 | CSV      | Reproduced |
|-----------------|---------:|-----------:|
| FY24 disb       | $32,482M | $32,482M   |
| FY24 obligations| $35,439M | $35,438M   |
| FY25 disb       | $24,968M | $24,968M   |
| FY25 obligations| $20,322M | $20,322M   |

Scope caveat: "Managing Agency = USAID" includes USAID-managed programs funded
out of the State Department appropriation (e.g., PEPFAR's GHP-State account),
and excludes USAID-appropriated funds managed by other agencies.

### Sector taxonomy

The 25 sectors named in `usaidcuts - sector.csv` plus an "Other" catch-all
containing every smaller FA.gov sector not individually listed. This
reproduces the CSV's "Other" row ($107M disb / $120M oblig) exactly. One
alias is applied: FA.gov's `Pandemic Influenza and Other Emerging Threats
(PIOET)` is rewritten to match the CSV label `Pandemic Influenza and Other
Emerging Threats`.

### Fiscal quarters

Federal fiscal-year convention, derived from the FA.gov `Transaction Date`
field:
- FQ1 = Oct-Dec (prior calendar year)
- FQ2 = Jan-Mar
- FQ3 = Apr-Jun
- FQ4 = Jul-Sep

Only 12 of 1.68 million USAID transaction rows lack a parseable
transaction date; those are retained in the annual totals but excluded from
the quarterly series.

### PEPFAR TX_CURR

`TX_CURR` is PEPFAR's end-of-quarter snapshot count of people currently on
antiretroviral therapy. The xlsx contains 253 country × age × sex rows; we
sum to a single quarterly national total per country. The totals are
bottom-up country aggregates and run about 1% below PEPFAR's published
topline numbers (e.g., 20.4M vs 20.6M in 2024), consistent with the note
on Figure 1 of Kenny's blog post.

### "$ predicted cut"

On the scatter figure, the x-axis is computed as
    predicted_dollar_cut = FY24_value × SK_prediction_percent / 100
rather than the raw percentage, so that large-budget sectors stand out.

## Caveats

- **FY2025 is incomplete.** The FA.gov snapshot we use was published
  2026-03-31 and flags FY25 as still being reported. FY25Q4 disbursements
  in particular look anomalously low ($2.5B vs the ~$5-13B typical Q4) and
  may be partly a reporting-lag artifact rather than a real drop.
- **Country allocation is coarse.** The FA.gov per-country HIV/AIDS
  disbursements exclude a ~$2.66B FY24 "World" bucket for unallocated
  regional/global programs. Actual per-country PEPFAR footprints are
  larger than the country-level figures shown here.
- **PEPFAR country aggregates** differ from the topline figures (see note
  above).
- **TX_CURR is a stock, spending is a flow.** Side-by-side comparisons
  of the two are suggestive, not structural: a 50% drop in quarterly
  disbursements does not imply a proportional drop in ART enrollment.

## Contact

This package was assembled to support blog-post figures at the Center for
Global Development. For questions about the underlying CGD analyses,
contact Charles Kenny or Justin Sandefur at CGD.
