On June 18, we published a story about how frequently shootings happen near schools across the United States. The story was based on our analysis of 10 years of data from the Gun Violence Archive as well as records from other sources. Here’s how we did it:

Data on shootings

The Trace analysis accessed the Gun Violence Archive via API to create a database of all shootings from 2014 to 2023 — 522,964 incidents in total.  GVA relies on media reports supplemented by other sources, including city violence dashboards where available, to identify shootings.  For this reason, some shootings are missing from the database, and some location data is imprecise.

Data on schools

Data on the locations of past and present K – 12 schools was gathered from the National Center for Education Statistics EDGE geographic datasets.  We removed from our analysis schools that NCES had coded as closed or virtual only.  

Public school location data is updated annually, and private school data is only updated biannually, so we joined shootings to the most current location data available for each school year. Therefore, it is possible that in some rare instances, schools — particularly private institutions —  were already closed when nearby shootings took place.  Likewise, it’s possible that a small number of shootings near schools were missed because a school was open before it appeared in the NCES data.

The private school data is also known to be incomplete, and The Trace did not extrapolate from it.  As a result, some private schools are missing from our analysis, making our shooting totals undercounts.

Data on students

We took demographic data on public schools from the 2023-2023 Common Core of Data, and private school data from the Private School Universe Survey. The PSS is only updated every other year, so we used 2021-2022 values to estimate 2022-2023 student populations for our analysis.

Data on locales

To determine whether a shooting took place at an urban, suburban, or rural school, we used the NCES’s school locale classification system.  For precise definitions, see here.

School names

Districts enter the names of schools and there is no standard format.  For example, Abraham Lincoln Elementary School could be entered as “Lincoln, Abraham Elementary,” or as simply “Abraham Lincoln.”  To the extent possible we standardized names, but some names likely remain jumbled.  We apologize.

Segregation data

Census tract-level demographic data was taken from 2022 five-year American Community Survey estimates.

Software

Our analysis was conducted using R version 4.1.2 (2021-11-01), and especially the ‘sf’ package (Pebesma, 2021) version 1.0.16.

Population density and school shootings

Our radius of 500 yards is more likely to capture shootings in cities where the population is densely packed around schools.  In places where schools are on campuses offset by parking lots, fewer shootings are likely to be captured.  However, population density isn’t sufficient to explain findings of particularly high nearby shootings in places like Philadelphia and Chicago, since New York City, Boston, and other dense cities did not have such high rates.

Shootings during and outside school hours

GVA’s data on the time shootings occurred is quite sparse and therefore not suitable to distinguish between shootings during and after school hours, so our analysis includes both.  However, our reporting found that shootings outside school hours still have a profound impact on students, who are exposed to crime scene tape, police cars, blood, shell casings, and other signs of violence.  Even the presence of impromptu sidewalk memorials can affect learning outcomes.