# girls-hs-sports-participation-by-state: how to reproduce

1. Download the NFHS High School Athletics Participation Survey PDFs for 2015-16, 2016-17, 2017-18, 2018-19, 2021-22, 2022-23, 2023-24, 2024-25 and 2025-26 (links in the dataset's sources) into one folder, `nfhs-dl`.
2. Convert each with xpdf/poppler `pdftotext -raw` (for the "Totals by State" table) and `pdftotext -table` (for the girls' wrestling and flag football columns).
3. `node parse.js nfhs-dl totals.json` reads the "Totals by State" table of each year (boys, girls, total participants).
4. `node sport.js <year>.table.txt WRESTLING` and `node sport.js <year>.table.txt "FLAG FOOTBALL"` read one girls' sport column by state. For 2018-19 and 2024-25, girls' flag football is in the "other sports" list and was transcribed into f1819.json and f2425.json. Every extracted column sums exactly to the NFHS national total for that sport and year.
5. Download Census Bureau files sc-est2019-agesex-civ.csv (July 1, 2015-2018) and sc-est2025-agesex-civ.csv (July 1, 2021-2025) into `nfhs-dl`. Ages 14-17 by sex are the denominators; school year Y-(Y+1) uses the July 1, Y estimate.
6. `node analyze.js` builds panel.json (state x school year, with group and per-1,000 rates) from totals.json, laws.json and the Census files; `node analyze2.js` adds the flag football and wrestling columns and computes every saved analysis in the dataset.

Difference-in-differences: for each state, change in the rate between the two school years; the estimate is the mean change in the 24 law states (laws first applied 2021-22 to 2023-24) minus the mean change in the 22 states with no statewide law or policy. 95% intervals use Welch's unequal-variance t interval with states as the unit. The population-weighted version uses a state bootstrap (5,000 draws, fixed seed).
