← Back to story

Demographic segregationMethodology recipe

PS 133 has a 77-point Black-white achievement gap inside one school

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

Identified the New York City schools with the largest within-school Black-vs-White proficiency gap by joining BLACK-subgroup and WHITE-subgroup ela_all_proficiency rows at the same school for 2024-25, then ranking by the absolute gap.

Data sources

  • Database tableschools

    One row per New York City public school (DBN, name, district, borough, school_type, grade_band, latest_enrollment, proclivity_decile, proclivity_score, closed_at, admission_category).

  • 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 school_year_metrics for BLACK and WHITE subgroups at the same school + year + metric.

    SELECT s.dbn, s.name,
           w.value AS white_pct, b.value AS black_pct,
           (w.value - b.value) AS gap
      FROM schools s
      JOIN school_year_metrics w ON w.school_dbn=s.dbn AND w.subgroup='WHITE' AND w.metric_key='ela_all_proficiency' AND w.year='2024-25' AND w.suppressed=false
      JOIN school_year_metrics b ON b.school_dbn=s.dbn AND b.subgroup='BLACK' AND b.metric_key='ela_all_proficiency' AND b.year='2024-25' AND b.suppressed=false
     ORDER BY gap DESC LIMIT 50;

Caveats

Subgroup-n thresholds for suppression (typically n<5) mean schools with very small Black or White populations are excluded. The gap captures composition × instruction; we can't decompose it here.

References

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.