Subscribe to DSC Newsletter

San Francisco Police Department Crime Incidents: Part 3-Categorical Data Analysis

Introduction

The City and County of San Francisco had launched an official open data portal called SF OpenData in 2009 as a product of its official open data program, DataSF. The portal contains hundreds of city datasets for use by developers, analysts, residents and more. Under the category of Public Safety, the portal contains the list of SFPD Incidents since Jan 1, 2003.

In Part 1 of this series of analysis, I performed an exploratory time-series analysis on the crime incidents data to identify any patterns.

In Part 2 of this series, I performed an exploratory geo analysis on the crime incidents data based on the San Francisco Police Department District classification to identify any patterns.

In this Part 3, I have performed an exploratory analysis on the crime incidents based on the category of the crime.

Data

The data for this analysis has been downloaded from the publicly available data from the City and County of San Francisco’s OpenData website SF OpenData. The crime incidents database has data recorded from the year 2003 till date. I downloaded the full data and performed my analysis for the time period from 2003 to 2015, filtering out the data from the year 2016. There are nearly 1.9 million crime incidents in this dataset.

I have performed minimal data processing on the downloaded raw data to facilitate my analysis.

Data source location: https://data.sfgov.org/data

Data source: https://data.sfgov.org/Public-Safety/SFPD-Incidents-from-1-January-...

Number of crime incidents processed: 1,859,850

Crime Categories

The SFPD categorizes all the crimes happening in its Police Districts under one of the following 39 categories.

Analysis

Total Crimes by Category

The following plot depicts the number of crimes recorded from the year 2003 till the end of the year 2015 ordered by the category of the crime.  By analyzing the plot above, we can clearly see that “Larceny/Theft” has been the most commonly occurring crime followed by “Other Offenses” and “Non-Criminal” crimes. Since these two categories are very generic, we cannot get much insight about these crimes. “Assault”, “Vehicle Theft”, “Drug/Narcotic” and “Vandalism” also occur in high numbers.

Top 10 Category of Crimes over the Years

The following plot depicts the trend of the top 10 category of crimes from the year 2003 till the end of the year 2015.By analyzing the trends in the plot above we can arrive at the following key insights:

  • There has been a steep increase in “Larceny/Theft” since 2011.
  • There has been a steep decline in “Vehicle Theft” since 2006 and has remained more or less at the same level since then.
  • “Drug/Narcotic” related crimes had peaked in 2009, but have declined since then.

Top 10 Category of Crimes in Police District

The following plot depicts the top 10 category of crimes in various Police Districts.By analyzing the plot above, we can arrive at the following insights:

  • As highlighted in red in the plot above, “Larceny/Theft” is the most common crime across the Police Districts with the exception of Bayview, Ingleside, Mission and Tenderloin.
  • The most common crime in Tenderloin is related to “Drug/Narcotic”.

The above is just a high-level exploratory analysis. With further in-depth analysis it is possible to arrive at more insights. In my future posts I will try to perform those analyses.

Technology

This analysis was performed entirely using RStudio version 0.99 and R Version 3.2.0.
The data processing and plots were done using the R libraries ggplot2 and dplyr.

Views: 888

Tags: Crime, Francisco, Police, San, analytics

Comment

You need to be a member of Data Science Central to add comments!

Join Data Science Central

Videos

  • Add Videos
  • View All

© 2019   Data Science Central ®   Powered by

Badges  |  Report an Issue  |  Privacy Policy  |  Terms of Service