← Back to story

Demographic segregationMethodology recipe

NYC's most demographically diverse schools serve mostly low-income kids

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

Built a Simpson's-diversity-index over (pct_white, pct_black, pct_hispanic, pct_asian) per school. Ranked descending; profiled the top 20.

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. Compute 1 − Σ(p_i^2) for each school's race shares; rank.

  2. Cross-tab with proclivity decile and admission_category to see what kind of schools score highest on diversity.

Caveats

Simpson's index treats all proportional mixes as equally 'diverse'; alternative definitions (e.g., centered on a target population) would surface different leaders.

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.