Visualizing Crime in Los Angeles

What are the factors affecting crime? Time of day? Day of week?

Abhinav Rao
Towards Data Science

--

Los Angeles is one of the globe’s megacities. It is a metropolis that attracts thousands of students like myself every single year. In August 2021, I will move to LA to study data science at the University of Southern California (USC). Ever since I made my decision, friends, family and other Angelenos have repeatedly reminded me that the area may not be the safest. So, I decided to take an informed look at the nitty-gritties of crime in Los Angeles during 2021 to ensure I make informed and data-driven decisions during my time in the city.

One of the things that struck me was that the crime data provided by LAPD was readily available for public use on the mayor, Eric Garcetti’s website. This is relatively rare even in today’s open data world. Anyway, let’s dive deep into this enormous dataset to gather some important insights.

After exploring and cleaning the data to analyze it suitably, I wanted to see the most common types of crime in the city.

https://public.tableau.com/views/Los_Angeles_Crime_Viz/common_crime_types?:language=en-US&:retry=yes&:display_count=n&:origin=viz_share_link

In 2021, the city of Los Angeles recorded more than 79,000 crime cases by the month of June. ‘Vehicle-Stolen’ accounted for more than 11% of all crimes and topped the charts. ‘Bike-Stolen’ accounted for 1% of all crimes. Being a student, I will most likely be riding a bike to college everyday and hence it was alarming to see significantly high numbers for bikes stolen.

Okay, we now know what type of crimes occur more often than others, but when do these crimes occur? Do they follow a specific time pattern or does a specific day in the week take the burden of more cases than others?

https://public.tableau.com/views/Los_Angeles_Crime_Viz/crime_count_by_day?:language=en-US&:retry=yes&:display_count=n&:origin=viz_share_link

The above treemap gives us some rather useful insights: weekends are trouble! Friday accumulated the most number of crime cases in the year and as the new week began, there was a reduction by almost 1,500 cases. The spike on Friday is most likely due to the onset of the weekend and more people heading out to socialize & party, leading to late night outs when crime is more likely to happen. Tuesday’s and Wednesday’s are the most peaceful in terms of crime in LA.

Time of day also plays an important role in crime. I have plotted a chart below where we have time of day in 24H format vs. the count of crime.

Crime dies down at about 5 am when most of the city is sleeping. This is very much expected. I also expected a peak at around the twilight hour at 6 pm when people are headed back home after work or are headed out to enjoy the night. What’s surprising to me is the increase to almost peak levels at midday. It will be interesting to see what type of crimes occur during these hours. I predict these crimes to be of the “softer” type including drug violations, theft and property crimes.

https://public.tableau.com/views/Los_Angeles_Crime_Viz/common_crime_hour?:language=en-US&:retry=yes&:display_count=n&:origin=viz_share_link

As I predicted, the table on the left/above clearly tells us that property crimes and burglaries are the most common crime types at midday where we see the daily high.

Although these crimes are frequent and unsettling, it is still relatively a safer time to head outside due to the nature of the crimes. However, if compared to a similar peak later during the day, around 7 pm, the picture changes.

https://public.tableau.com/views/Los_Angeles_Crime_Viz/common_crime_hour?:language=en-US&:retry=yes&:display_count=n&:origin=viz_share_link

The number of assault crimes have significantly gone up as the sun sets. Deadly assaults have risen to an alarming 294 while assaults on partners also increases. The ‘softer’ crimes also go up and the number of vehicles stolen almost doubles from the number at midday.

While this provides valuable insight into what times of day are safer, I am still not completely satisfied. There are other factors that need to be considered here like the area with high crime counts. More importantly, I want to know how crime is distributed around the University of Southern California’s University Park campus, where I will be spending most of my time for the next two years. First, I plotted the distribution of crime in the surrounding area. The dataset provided crime scene locations through geographical coordinates which made it simple to plot in Tableau.

https://public.tableau.com/views/Los_Angeles_Crime_Viz/map_viz_crime_dist?:language=en-US&:retry=yes&:display_count=n&:origin=viz_share_link

The opacity of the markers portrays single crime locations that are close to each other and hence form a cluster of crime data points in the area. Where the markers are dark, there is frequent crime trouble. Figueroa St on the east side of campus has multiple clusters indicating higher crime counts there. I am an avid runner and the time and location insights we have gained are assisting me in figuring out suitable running times and potentially safe running routes! Let’s keep exploring. What about crime types in the USC area?

https://public.tableau.com/views/Los_Angeles_Crime_Viz/crime_count_usc?:language=en-US&:retry=yes&:display_count=n&:origin=viz_share_link

‘Vehicles-Stolen’ continues to dominate the most common crime type and there seems to be a lot of vandalism and theft in the area. The ‘Assault With Deadly Weapon’ field makes the top 7 although I want to see how it does at ‘peak’ crime hours i.e. midday & twilight.

When the ‘hour of day’ filter is applied on the above table, ‘Assault With Deadly Weapon’ does not make the top 7 for midday and at 7 pm. This is reassuring, so at what times are heinous crimes most common?

https://public.tableau.com/views/Los_Angeles_Crime_Viz/assault_crime?:language=en-US&:display_count=n&:origin=viz_share_link

Assault crimes rise around 4 pm and again during night-time at 8 & 11 pm. In a report by the ‘Security’ magazine, assault crimes are most likely to occur at night-time in the US and my plot confirms that. Once again, this plot is reassuring and helps the readers of this article make data-driven decisions about planning their day if they happen to be living in the Los Angeles area.

Moving on, with Los Angeles being a melting pot of different cultures and races, I wanted to see if certain groups of people are victims of crime more than others.

The above racial and victim descent categories were defined in the dataset by LAPD and have been reproduced as is. ‘Hispanic/Latin/Mexican’ people suffer the most in terms of crime in the city followed by ‘White’ and ‘Black’. ‘Other Asians’ are fourth highest. Having taken a look at population diversity data for Los Angeles, the numbers provide a possible reason. 49% of the Los Angeles population has been categorized as ‘Hispanic/Latin/Mexican’. Using probability, one can identify distribution of population as a reason why these two races top the charts for victims of crime in the city. (Disclaimer: I have not considered factors such as racial bias affecting crime in this article due to lack of quantifiable data.)

The average age of victims in the city is 29.82 which indicates that relatively young people are susceptible to crime. Why not look at crime count by gender too.

https://public.tableau.com/app/profile/abhinav.rao/viz/Los_Angeles_Crime_Viz/crime_by_gender

The dataset classified gender by male/female/unknown and hence no other gender identifications were possible. Although Los Angeles county has a higher female to male ratio, we still see more men being victims of crime. According to an article published by M E Lewyn in the San Diego Justice Journal, men are more likely to be victims of violent crime. In our case, we have proven it through our pie chart above.

Although the area around USC in Los Angeles has gained a reputation for being ‘unsafe’ and while there is data to back that claim up, further analysis and study of the dataset provided by LAPD has led to conclusions that there are certain times in the day where more serious crimes take place than others. Moreover, as the weekend approaches, it is more likely that a crime occurs as compared to weekdays. We also know which streets around USC are relatively safer than others and which streets could be avoided during ‘peak’ crime hours. While the apprehension around me regarding the place is justified to an extent, anyone who has read this article can take away some important insights that will enable them to make data-driven decisions in their everyday lifestyle. There is lot to enjoy and experience in Los Angeles provided it is done responsibly. I look forward to experiencing the beauty of California this coming Fall and beyond!

DISCLAIMER:

  1. All opinions expressed in the above article are based on the dataset provided by LAPD.
  2. At the time of publishing, Medium does not support embedding of Tableau visualizations and hence I have provided URL's to the original visualizations in the caption where the reader can apply more filters to see the data as they like.

--

--

I like to tell compelling & meaningful stories using data. MS Applied Data Science @ USC (May ‘23)