Crime Incidents of Alcohol in San Francisco

Alcohol + SF != Fun

Mario Javier Carrillo
plata
5 min readDec 5, 2017

--

When you think of crimes and their categories, the San Francisco Police Department Incidents website provides a long, yet “clean” list from where one can dive in to examine patterns of crimes.

One can look for property violations (i.e., larceny-theft, burglary, vehicle theft), violent crimes (i.e., robbery) or violations related to alcohol (i.e., drunkenness, driving under the influence). I will concentrate on drunkenness incidents. After all, if you live in the city by the bay or plan to visit, you might want to know what has been the pattern of events related to being “under the influence of alcohol in a public place”?

Different from what you can find on a travel website, the San Francisco Police Department uses its own variant of district stations called PdDistrict, which are also found in the incidents dataset. I will refer to the PdDistrict as districts from here on.

Trends

The total number of incidents reported by the San Francisco Police Department website shows a decline of events from 2003 to 2011, a sharp increase from 2011 to 2015, and a steep drop from 2016 onwards. On the other hand, drunkenness incidents have been more or less steady from 2003 to 2012 and dramatically increased from 2012 to 2013, followed by a steady decline from 2013 onwards.

When one looks at the trend of drunkenness incidents on each district we see that from 2006 to 2007 and from 2012 to 2013 there was a 50% increase of events in the Mission district (east of Twin Peaks to the James Lick Freeway, and south of Market Street to Cesar Chavez Street).

This is not the case in the Southern district (includes the Ferry Building, continuing south from Mission Street to Mariposa Street and east to the Bay, South of Mission, Embarcadero, and China Basin areas). In this district from 2006 to 2007 there is a slight decline of events, but a steep increase of more than 100% incidents from 2012 and 2013.

The Tenderloin district (area bordered by Geary, Market, and Larkin streets), has a steady pattern until 2007, an increase of over 100% until 2009, followed by a decline and another rise of incidents from 2012 to 2013.

The tourist area of San Francisco, the Central district (includes the Financial district, Chinatown, North Beach, Fisherman’s Wharf, and the three famous hills: Telegraph, Nob, and Russian), shows an overall decline trend — that is good news for our visitors!

A closer comparison of the cumulative number of incidents in 2015, 2016 and 2017 shows a decrease of events in the Mission, Southern and Central districts, but a slight increase in 2016 in the Tenderloin district. In general, in 2017 we see a decline of drunkenness incidents in all of the districts, but keep in mind that the 2017 data used in this analysis includes incidents up until November 5th. However, with the end of the year holidays around the corner we should expect an increase in events.

Now you are probably wondering — what months or seasons of the year are the ones with the highest number of drunkenness incidents?

In 2016 March, May, July, October, and December registered the highest peaks. These peaks could potentially be influenced by the beginning of Summer, end of Spring semester for college students, Halloween, and the end of the year (holiday parties). Meanwhile, the trend in 2017 displays peaks in May, August, and October.

We can also see that in 2016 during January, May, July, and August the Mission district had a large number of drunkenness incidents, and so far in 2017 the months of August and October presented the highest number of occurrences. The month of March shows a peculiar increase of drunkenness events from 2016 to 2017 in the Southern district (almost 25%) and a decrease of more than 50% during the same years in the Central district.

Looking at the frequency of occurrence of drunkenness incidents by season during the last 3 years, it shows that the San Francisco Police Department is busier during the Spring and Summer seasons, and not so much during Winter and Fall.

Mapping the incidents

If you are not familiar with San Francisco or have not visited yet, all the previously mentioned streets and districts do not mean much to you. A map can help! Explore this map (same map as below) where the red dots represent the 2016 drunkenness incidents, and the black marks represent the 2017 incidents.

Now, if you share this map with your geospatial analyst or data scientist friend, I guarantee that they would like to see a more granular map, one that uses census tract . No worries, I have you covered! Take a look at this choropleth map where so far in 2017 in the inner section of San Francisco, the density of drunkenness incidents stretches from 5 to nearly 41 incidents per square kilometers…. that is a lot!

That sounds and looks like a credible number, but can we do a little spatial analytics to be satisfied with our previous map?
Using spatial weights and spatial lag (spatial autocorrelation — how heavily the data in one polygon is predicted by its neighbors) to match together areas which are neighbors with another is one way to do this analysis. In the following map, I implemented a queen continuity, which is a spatial weight concept of “neighboorhood-ness” based on the idea that cells sharing a common edge or common vertex are considered contiguous or neighbors. Additionally, I used Moran’s method to measure autocorrelation and measure statistical significance. The results show that the densities (clusterings) we predicted in the previous map are close to the real values and that our dataset has a strong geographic element.

The good news is that there seems to be an overall decline of drunkenness incidents in 2017, compared to 2016 and 2015!

That’s it for now! You can find the code used for this post on GitHub. If you have questions, want to talk more about this analysis or discuss other projects, you can DM me on Twitter.

--

--

Mario Javier Carrillo
plata
Writer for

Machine Learning + Stats + DeepLearning = “My Lego World”