Visualizing the Factors Associated With Homicide in Philadelphia in 2022 Using Publicly Available Data

The dots on a map may seem like they are clustering, but are they just indicating the clustering of something else?

René F. Najera, MPH, DrPH
5 min readNov 15, 2022

Using Philadelphia’s open data portal, I downloaded the Part 1 crime data reported between January 1 and November 8, 2022. I then filtered the data for only criminal homicides, and I threw the location of those homicides on the map of neighborhoods in Philadelphia shown below.

Map of neighborhoods in Philadelphia with red dots showing the location of homicides.

At first glance, you might see some clustering of the red dots here and there. Clusters naturally catch our attention and we are drawn to them. Some people might even estimate their risk of being killed by looking at where they live and the location of those visual clusters.

What About Population Size?

To account for population size, it is necessary to get the population of the locations of those homicides. For this exercise, I downloaded the 2015–2020 population estimates from the American Community Survey (ACS) from the US Census Bureau. (I used the tidycensus package in R.) Now, let’s join the dots to their respective census tracts, and then calculate a rate of homicides by census tract. This is the map that…

--

--

René F. Najera, MPH, DrPH

DrPH in Epidemiology. Public Health Instructor. Father. Husband. "All around great guy."