← Back to story

Subgroup gapsMethodology recipe

Boys outperform girls in math, girls outperform boys in ELA — even by 5th grade

A reproducibility log: the data this analysis touched, the queries it ran, the outside sources it leaned on, and the steps a third party would follow to re-run it.

Summary

For the most recent state-test year, joined FEMALE and MALE subgroup proficiency at the same school for grade-5 math and ELA. Computed within-school gender gaps and citywide averages.

Data sources

  • Database tableschool_year_metrics

    Long-format per-school per-year metric facts (school_dbn, year, metric_key, subgroup, value, suppressed). Loaded from DOE/NYSED public files via scripts/loaders/*.

Steps

  1. Self-join FEMALE and MALE rows of the math_grade5_proficiency and ela_grade5_proficiency metrics at each school for 2024-25.

    SELECT s.dbn, f.value AS f_val, m.value AS m_val, (m.value - f.value) AS gap
      FROM schools s
      JOIN school_year_metrics f ON f.school_dbn=s.dbn AND f.subgroup='FEMALE' AND f.metric_key='math_grade5_proficiency' AND f.year='2024-25' AND f.suppressed=false
      JOIN school_year_metrics m ON m.school_dbn=s.dbn AND m.subgroup='MALE'   AND m.metric_key='math_grade5_proficiency' AND m.year='2024-25' AND m.suppressed=false;

Caveats

Gender categories are binary in NYC reporting. Suppression of small subgroup-n means small schools drop out; the citywide read is from schools with sufficient cell sizes.

Reproduce

Clone the repo, set DATABASE_URL to a Postgres with the project schema loaded, run `npx tsx scripts/loaders/<source>.ts` for any not-yet-loaded data, then issue the queries in the Steps section. The story page also lists the exact `metric_key`/`subgroup`/`year` filters used. Searchable by the answer's headline number — every figure is recomputable from the queries shown.

The recipe lives at data/stories/recipes.ts in the repo. Corrections welcome.