Greg Filla recently posted an extension for IBM SPSS Modeler that pulls weather information from the Weather Underground. I found this extension to be exciting, so I decided to use it to perform an exploratory analysis on the correlation between outdoor high temperature and crime in the city of Chicago. Is there a link between crime and temperature?
I used IBM SPSS Modeler and IBM SPSS Statistics for this analysis, the Weather Underground extension, and data from the City of Chicago Data Portal. After collecting and aggregating all required data in SPSS Modeler, I then pulled the data into SPSS Statistics to perform the in depth analysis.
I first graphed the count of crimes by year from 2005-2015. You can see the top 4 most frequently occurring crimes in Chicago from 2005-2015 are theft, battery, criminal damage, and narcotics violations. The overall downward trend is comforting, but the question we want to address is if any of these crimes are correlated with temperature.
So next, I graphed the overall number of crimes vs. high temperature. There’s an upward trend, but I ran a correlation to see if it is statistically significant. Note that there are outliers in the dataset, but I did not remove them from this analysis.
With a correlation of 0.442 overall crimes are moderately correlated with temperature. Breaking it down into individual crime types shows assault, battery, and gambling exhibit a strong correlation over 0.5. Let's take a closer look at assault and battery by graphing these vs. temperature. Notice here too the strong correlation between these two crimes. (I'm going to skip the analysis of gambling, because further analysis has shown the occurrence of gambling crimes in Chicago has reduced significantly to a quarter of its peak in 2007.)
Notice there is a definite upward linear trend to this data for both assault and battery. It does make sense that these crimes are correlated with temperature; further analysis showed that 40% of all assault crimes and 37% of battery crimes in this time period occurred outdoors on sidewalks, streets, and alleys.
The amount of assault and battery crimes has gone down 35% and 41% respectively over this time period.
So crimes and outdoor temperature are moderately linked, but none more strongly than assault and battery. There’s still much insight locked away in this dataset, so I encourage you to download trials of SPSS Modeler and Statistics and give this analysis a try yourself.