OIDD 245 Data Project 2 By: Helen Qi
Law enforcers around the country are trying to understand different correlations between crimes and any attribute that may help them predict the occurrences of certains violations, especially in cities where crime rates are at an all time high. Successful prediction not only allows these officials to become more prepared on how to handle future violations (ie how many officers they should have on duty), but also warns the public on when to be more cautious and aware of their surroundings.
A simple factor that our whole population knows of that may help us successfully predict crimes is weather. Seasonal temperature fluctuations may have an impact on the number of crimes certain cities experience. To put this to the test, we looked at the respective crime data from three major cities: Chicago, Los Angeles, and NYC. These cities’ datasets provide information on every documented crime that happened in each respective city including details on date, time, and type of crime that was committed. In addition, these cities were chosen because they are all located in separate geographical areas with varying weather conditions. The difference in crime patterns from 2018–2020 in these three cities are displayed below.
One similar pattern across all three graphs is the general dip in crimes when the Coronavirus national shutdown happened in 2020.
We can also see that overall NYC and Chicago have more crimes than LA. Chicago in particular has clear peaks in the summertimes, but as for NYC and LA it’s harder to see a distinct overall pattern, so we will be looking at smoothed lines when we graph it with each cities’ respective temperature data in the following section. These smoothed lines were produced using the estimates of the conditional mean function, and note that all temperature data was converted to Fahrenheit for consistency.
Crimes and Temperature
The temperature data we looked at in this section just included the average fahrenheit measurements per day for every major city. When joining this with the crime data for each city, both Chicago and LA crimes showed positive correlations with the weather. Chicago had more varying temperatures and a more significant correlation from the graph above whereas LA temperatures on average were less varying which would make sense with a weather correration. In other words, this is interesting to note because perhaps the intensity of the weather in Chicago contributes to the more significant increase in crime in the summer for Chicago compared to LA.
From this finding, it is possible that depending on where someone lives, if the weather has larger fluctuations throughout the year, people may predict a greater increase in crimes in warmer months and a larger decrease in crimes in colder months. This would be extremely helpful for police departments to help allocate their resources more effectively and for the general public to take even more precautions than they would normally if they live in those types of cities in the hotter months.
On the other hand, NYC seemed to have a different relationship. For the graph below on the right we can see that until about half way through 2019, there is a slight inverse correlation between the number of total crimes and temperature in NYC. However, there is also a general decrease in crimes overall during this time period for NYC, so it’s harder to see the pattern. To investigate further, we found more historical data on past crimes and past weather. On the graph to the left it’s clear that the general decrease in crimes is still present, but there is little correlation with NYC crimes and temperature. We can see a slight peak around July 2017 but it is unclear if this is enough to state a reliable yet significant relationship.
So while we can note the positive correlation between crime and weather for Chicago and LA, the data on NYC crimes and weather leads us to an inconclusive verdict on whether the total number of crimes and its relationship with temperature for this particular city. But what if we break the crimes down into distinct categories? Can we find more helpful correlations on specific types of crimes for each city?
Specific Crime Categories and Weather
While it’s useful to know the general overall trends for crimes and weather so officers can anticipate when more crime will happen, it’s more helpful to see if crimes within specific classifications have a stronger or weaker relationship with the weather to augment the predictions that workers in law enforcement can obtain. Below we will look at some of the more common types of crimes in each of the three cities, and analyze each breakdown.
We can first take a look at Chicago where theft and battery are the top two crimes. Both have a very strong correlation with the temperature patterns over the course of 2018 and 2020. Deceptive practice and assault in Chicago occur less, and there is a weaker correlation between those types of crimes and temperature. For those living in Chicago it may be helpful to be extra attentive with their personal items and aware of their surroundings during these hotter months since there are spikes in the number of committed acts, especially thefts.
In Los Angeles, even though theft is the most common crime type, assault is actually the one with the closest correlation with temperature. Battery has a slightly weaker correlation, but its correlation is stronger than robbery’s.
Finally, in NYC, we also see that assault has a positive correlation with temperature. Moreover, we can see that the other types of crimes don’t have as strong of a correlation with temperature which makes sense since we discovered in the section above that the correlation between total number of crimes and temperature was not strongly positive for NYC. However, knowing that the number of assaults is higher when the weather is warmer helps officials and the general public more accurately predict assault trends in the future, and can help prepare officials to handle these transgressions.
Some cities clearly have more helpful correlations than other cities when it comes to determining the relationship between different categories of crime and temperature. Regardless, knowing any specific trends attached to each crime type can be very advantageous for both the public and the police department because it makes us all better equipped to handle and even prevent these misdemeanors.
Historical Wind and Humidity Data
So we know there are certain correlations between crime and temperature using the recent data available, but what about other weather factors such as humidity and wind speed? Here we take a deeper dive into the relationships between temperature, wind and humidity for crimes committed during 2015–2017 where there will be no influence from the pandemic, and where there is more holistic data available for more specific factors like wind and humidity. Each of the three different temperature, wind and humidity data sets included the respective fahrenheit, miles per hour and percentage measurements for every hour of each day, so we took the average across each day to be consistent with the rest of our analysis. We joined this data together with historical data on crimes for Chicago, LA, and NYC for further exploration.
Each of the pink highlighted lines represent the crime count whereas the blue highlighted lines represent temperature, wind, and humidity over the course of 2015 to 2017 respectively. Usually, people expect it to be more humid during the warmer months and more windy during the cooler months so it wouldn’t be surprising if, for a certain city, if it had a positive correlation with temperature, it would show a positive correlation with humidity and a negative correlation with wind. Let’s see if this holds true.
Let’s first take a look at Chicago’s data. We see that there is still a positive correlation between temperature and number of crimes, a strong inverse correlation between crime count and wind speed, and a negative correlation between humidity and crimes until 2016 where the correlation becomes positive. This city matches up the most with our prior predictions where a positive temperature correlation may also insinuate a negative wind correlation.
Taking a closer look at Los Angeles’ data, we see that there is still a slight positive correlation between temperature and crime but because the change in crimes is lower, it’s harder to see any stronger relationships. In terms of its relationship with wind speed, there’s a positive correlation until early 2016 and then the correlation becomes negative so no significant conclusion can be said from this pattern. Humidity has a drop around the 2016 mark which is also where crimes have a slight drop so there may be a positive correlation associated with crimes and humidity.
NYC on the other hand still shows a general decrease in the number of crimes after mid 2015, and a slight increase in the summer months of 2016. There is a slight positive correlation between crimes and temperature, but no distinct, consistent correlation for wind and humidity across all two years.
While it’s interesting to see the different correlations with other weather attributes, temperature remains the best way for people to predict crime activity because none of the other weather traits showed a significantly stronger correlation with crimes in comparison to temperatures. This is beneficial to the general public because temperature knowledge is also more widely known compared to other weather attributes such as humidity and wind speed.
Conclusion
Generally, each seasonal correlation with crimes depends on what individually city we are looking at. Within each city we saw some compelling correlations between total crimes, specific crimes and weather data, and it would be worthwhile for every city department to conduct this analysis if they want to discover another possible way to predict crime.
Other factors that also could be interesting to look at might be air quality and pollution, pressure, and even pollen levels. While some of these factors have some influence from weather, it could be beneficial to find a specific weather factor that is even more accurate than temperature. One could also take an even deeper dive into the crime data and see whether weather impacts certain types of criminals more than others in varying traits such as age and race.
Finally, the pandemic has clearly had some impact on the total number of crimes and while the most recent weather and crime data didn’t have information extending into late 2020 and 2021, it would be advantageous to do more analysis on recent trends on both the pandemic and weather impact on crimes.