Tucson Crime Analysis

INFO 526 - Fall 2024

Tucson Crime Data Analysis
Author
Affiliation

VIZards

College of Information, University of Arizona

Introduction and Data

Tucson, Arizona, like many cities, faces challenges related to crime and public safety. Crime analysis is an essential tool for local law enforcement, city planners, and community stakeholders to understand crime trends, allocate resources effectively, and improve overall public safety. By examining historical crime data, law enforcement agencies can identify patterns, develop strategic responses, and engage the community in crime prevention efforts.

Motivation for the Project

The goal of this crime analysis project is to provide a clearer understanding of crime patterns in Tucson, enabling both law enforcement agencies and the local community to work together towards creating a safer environment. By analyzing historical crime data, we can uncover trends in the types, locations, and timing of criminal activity across the city. This project aims to shed light on areas that need more focused intervention, whether it’s tackling property crimes like burglary in specific neighborhoods or addressing violent offenses such as aggravated assault and homicides. The motivation behind this project is not just about tracking numbers; it’s about finding actionable insights that can directly improve the quality of life for Tucson’s residents, ensuring that law enforcement strategies are more effective and that the community feels safer.

Ultimately, the project is driven by a commitment to creating a deeper connection between the police and the public they serve. It’s about empowering people—whether they’re community members, policymakers, or officers—to make informed decisions based on real data. By analyzing crime trends, we can identify where resources are most needed and collaborate with community groups to prevent crime before it happens. This human-centered approach recognizes that behind every statistic is a person, a family, or a neighborhood, and the aim is to provide tools that help reduce the fear and impact of crime in the daily lives of Tucson’s residents.

Data Source

The data is sourced from the Tucson Police Department’s Crime Reporting System, specifically the publicly available records on reported crimes from their official crime data portal. This dataset includes detailed information about incidents reported to the police, including crime types, locations, and timestamps, as well as demographic details related to the offenses. By leveraging this data, collected through official police reports, we can ensure accuracy and reliability in understanding crime trends across Tucson. The data is continuously updated and reflects a wide range of criminal activities, providing a comprehensive view of the city’s crime landscape for analysis and informed decision-making.

Website link : https://policeanalysis.tucsonaz.gov/pages/reported-crimes

Data description

This dataset contains incident reports related to various criminal activities recorded by a police department. It includes information about the date and time of the incident, the location, nature of the crime, and offense descriptions. Each row represents a unique incident (identified by IncidentID) with additional details such as the specific offense category, location, call source, and related timestamps.

This dataset can be used for analyzing crime patterns over time, geographic distribution of specific crimes, and the response to different types of criminal activities within various divisions and wards.

Column Descriptions

  1. IncidentID:

    • Description: A unique identifier for each incident.

    • Type: Integer/String

  2. DateOccurred:

    • Description: The exact date and time when the incident occurred. This includes both the date (Month/Day/Year) and time (Hour:Minute AM/PM).

    • Type: DateTime (Format: MM/DD/YYYY, HH:MM AM/PM)

  3. Year:

    • Description: The year when the incident occurred.

    • Type: Integer

  4. Month:

    • Description: The month when the incident occurred (written in full text).

    • Type: String (e.g., “March”, “June”)

  5. Day:

    • Description: The day of the week when the incident occurred.

    • Type: String (e.g., “Mon”, “Fri”)

  6. TimeOccur:

    • Description: The hour and minute of the incident occurrence in 24-hour format.

    • Type: Integer/String (e.g., “2054”, “0243”)

  7. Division:

    • Description: The division or district of the police department where the incident occurred.

    • Type: String (e.g., “Midtown”, “South”)

  8. Ward:

    • Description: The specific area or ward where the incident took place. This typically refers to a geographic division within a city or jurisdiction.

    • Type: Integer

  9. UCR:

    • Description: The Uniform Crime Reporting (UCR) Code representing the broad category of crime.

    • Type: Integer (e.g., 05 for Burglary, 01 for Homicide)

  10. UCRDescription:

    • Description: A description of the UCR code category, providing a more general classification of the crime (e.g., “Burglary”, “Homicide”).

    • Type: String

  11. Offense:

    • Description: A specific code identifying the detailed nature of the offense (e.g., 0501 for Burglary with Force, 0101 for Murder).

    • Type: Integer

  12. OffenseDescription:

    • Description: A more specific description of the criminal act that occurred (e.g., “Burglary - Force”, “Criminal Homicide - Murder”).

    • Type: String

  13. CallSource:

    • Description: The source from which the crime was reported or detected. It could indicate whether the incident was reported via a 911 call, routine patrol, or other means.

    • Type: String (e.g., “Call for Service”, “Routine Patrol”)

Research Questions

1. What are the patterns of crime incidents across different types of crimes (e.g., theft, assault) over time in Tucson?

Importance

This question aims to identify trends in crime activities, such as peak times or specific types of crimes that occur more frequently. Understanding these trends can help towards community safety initiatives.

Types of Variables

  • Crime Type : Categorical

  • Date/Time : Quantitative - Time Series

  • Frequency of Occurrences : Quantitative

2. How is the distribution of different types of crimes spatially distributed across various wards and divisions in Tucson over the years?

Importance

Understanding the geographic distribution of crimes can help law enforcement and community identify hotspots and allocate resources to areas with higher crime rates. It also provides insights into the social dynamics of different regions.

Types of Variables

  • Location (Ward/Division): Categorical

  • Crime Type : Categorical

  • Number of Incidents : Quantitative

The dataset can be analyzed to identify trends in criminal activity, study the effectiveness of police response strategies, and potentially help inform resource allocation in different districts or wards.

Summary of Reported Crimes in Tucson
Count and Most Recent Occurrence by Crime Type
Crime Type Number of Reports Most Recent Reported Date
06 - LARCENY 125,045 2024-05-01
05 - BURGLARY 16,797 2024-05-01
07 - GTA 14,859 2024-05-01
04 - ASSAULT, AGGRAVATED 13,923 2024-05-01
03 - ROBBERY 6,586 2024-04-30
02 - SEXUAL ASSAULT 2,892 2024-05-01
08 - ARSON 1,182 2024-04-29
01 - HOMICIDE 404 2024-04-28

Exploratory Data Analysis (EDA)

This report summarizes the steps and insights derived from exploratory data analysis (EDA) of the Tucson crime dataset. It encompasses data preparation, filtering, geospatial analysis, crime categorization, and trend analysis to uncover patterns and variations in criminal activity over time.

1. Data Loading

The first step involved loading the Tucson crime dataset into the environment. Key highlights include:

  • The dataset was read in a structured format (likely CSV or similar), and its structure was reviewed to ensure proper understanding of columns and data types.

  • Summary statistics and data types were checked to verify the integrity of the dataset. Missing values and inconsistencies were identified for potential cleaning.

Purpose: This step ensured that the data was ready for manipulation and subsequent analysis.

2. Data Filtering and Transformation

Data transformation and filtering were performed to make the dataset analysis-ready and to focus on relevant insights. Key actions taken include:

  1. Date and Time Parsing:

    • Dates were parsed and converted into a standard format to enable temporal analysis.

    • A year column was extracted for tracking yearly trends in crime occurrences.

  2. Categorical Filtering:

    • Crime types were categorized and grouped into broader classifications, such as Larceny, Burglary, Aggravated Assault, Robbery, and Homicide.

    • Filtering was applied to exclude irrelevant or incomplete records, improving dataset quality.

  3. Data Transformation:

    • Aggregations were performed to calculate annual and ward-level crime counts.

    • Percentages of crime types were derived for understanding their distribution across different years and geographical regions.

Purpose: This step ensured the dataset was cleaned, well-structured, and enriched with derived features for deeper analysis.

3. Geospatial Analysis

Geospatial analysis was a key component of the EDA, aimed at understanding the geographical distribution of crimes across Tucson. Key actions included:

  1. Mapping Crime Locations:

    • Geospatial data (latitude and longitude) was used to visualize crime occurrences on a map.

    • Crime hotspots were identified, with a focus on wards and divisions in Tucson.

  2. Ward-Level Analysis:

    • The dataset was grouped by wards to calculate total crimes reported in each area.

    • Wards with consistently high crime rates (e.g., Ward 3) were identified as high-priority areas for intervention.

  3. Heatmap Visualization:

    • A heatmap was created to highlight regions with higher crime intensity, revealing the spatial concentration of criminal activities.

Purpose: Geospatial analysis provided actionable insights into crime patterns, helping to pinpoint regions requiring focused law enforcement efforts.

4. Crime Type Categorization

Crime categorization involved grouping incidents into meaningful categories to analyze their distribution and trends. Key insights include:

  1. Major Crime Types:

    • Crimes were categorized into primary types: Larceny, Burglary, Aggravated Assault, Robbery, and Homicide.

    • A separate category, Other Crimes, was used for less frequent or uncategorized incidents.

  2. Temporal Trends:

    • The relative proportions of crime types were analyzed over the years (2018–2024), identifying shifts and emerging patterns.

    • Larceny was consistently the most reported crime, while homicides remained rare.

  3. Regional Variations:

    • The distribution of crime types was compared across wards and divisions. For instance, Ward 3 showed a high prevalence of larceny and burglary.

Purpose: Categorizing crimes allowed for focused analysis of trends and identification of priority areas for each crime type.

Methodology

Our approach to analyzing and visualizing the Tucson Police Department’s Reported Crime dataset emphasizes interactive and intuitive visual storytelling techniques. The methodology comprises several steps, including data preprocessing, exploration, transformation, and visualization, tailored to answer the research questions effectively.

Data Preprocessing and Transformation

The dataset was cleaned and preprocessed to handle missing values and inconsistencies. Temporal variables, such as the date and time of incidents, were formatted to support time-series analysis. Spatial data, including ward and division boundaries, were geocoded and integrated with geographic shapefiles to enable map-based visualizations.

For Research Question 1, data was aggregated by year, crime type, and hour of the day to uncover temporal patterns and trends. For Research Question 2, crime incidents were spatially grouped by wards and divisions over time. This step ensured the data was structured appropriately for visual representation.

Visualization Techniques and Tools

We utilized R (ggplot2) and Shiny to create an interactive dashboard for both spatial and temporal analysis. Below are the specific visualization methods employed:

Research Question 1: Patterns of Crime Incidents Over Time

  1. Line Charts:

    • Purpose: To illustrate crime trends over time for different types of crimes.

    • Justification: Line charts effectively capture temporal changes and trends, allowing stakeholders to observe fluctuations in crime incidents across years (2018–2024) for each quarter.

    • Implementation: The chart was plotted with incident count vs Time, ensuring clear differentiation and comparability.

  2. Bar Charts:

    • Purpose: To depict hourly crime distribution across the day.

    • Justification: Bar charts provide a straightforward representation of categorical data (hours) and their quantitative measures (crime count), highlighting peak hours.

    • Innovative Element: Color gradients were used to represent time segments (dawn, morning, afternoon, evening, night), improving visual interpretability.

Research Question 2: Spatial Distribution of Crimes

  1. Choropleth Maps:

    • Purpose: To visualize the geographic distribution of crime incidents across wards in Tucson.

    • Justification: Choropleth maps offer a spatially intuitive representation, highlighting crime hotspots and low-crime areas. Color gradients were used to represent crime density, making it easy to identify patterns.

    • Tools: Leveraged Leaflet for interactivity, allowing users to explore specific wards and view detailed crime statistics.

  2. Side-by-Side Bar Charts:

    • Purpose: To show the distribution of different crime types across divisions.

    • Justification: Side-by-Side bar charts highlight the relative and absolute frequencies of crime types within each police division, providing a comparative overview of crime distribution.

    • Enhanced Interaction: Tooltips displaying exact counts were added to improve usability.

Additional Features and Innovations

  • Interactivity: The Shiny dashboard includes dropdowns to filter by year, crime type, and ward/division, ensuring users can customize the analysis based on their interests.

  • Dynamic Maps: The inclusion of geospatial layers and zoom functionality in maps enhances user engagement.

  • Color Encoding: Consistent and meaningful use of colors ensures clarity in distinguishing crime types and time periods.

  • Responsiveness: The visualizations are designed to adapt to different screen sizes and user inputs, improving accessibility.

Rationale Behind Visualization Choices

Each visualization method was carefully chosen to align with the data characteristics and research questions. Line and bar charts simplify temporal trends, while maps offer actionable insights into spatial distributions. The interactive design enhances user experience, making the analysis more accessible and engaging for both technical and non-technical audiences.

Results

  1. Research Question 1: Tucson Crime Trend Analysis

  2. Research Question 2: Tucson Crime GeoSpatial Analysis

Conclusion

This project provides valuable insights into the patterns and trends of criminal activity across the city. It gives the key insights into crime patterns:

  1. Temporal Trends: Larceny and burglary were the most common crimes, though burglary declined over time. Certain categories like aggravated assault exhibited stable trends, while others, such as robbery, showed slight annual variations.

  2. Geospatial Insights: Crime hotspots were identified reporting higher crime rates, particularly for property crimes like larceny and burglary. Heatmaps and geographic visualizations highlighted areas requiring increased law enforcement attention and community safety initiatives.

  3. Crime Distribution: Property crimes dominated, with clear regional differences highlighting the importance of localized strategies. Regional differences underscored the importance of tailoring law enforcement strategies to specific areas.

  4. Community Impact: The analysis emphasized a human-centered approach, aiming to reduce the fear and impact of crime by informing strategic interventions, emphasized actionable insights to reduce crime and strengthen police-community collaboration.

Future Work

  1. Advanced Predictive Analytics: Use machine learning to forecast crime trends and hotspots.

  2. Integrated Data: Combine crime data with socioeconomic and urban factors for deeper insights.

  3. Community Engagement: Develop tailored prevention programs and share findings through public dashboards.

  4. Focus on High-Impact Crimes: Expand analysis to address less frequent but severe crimes like homicides.

  5. Location of the Crimes are not available in the data, Data is only formed as per the Tucson Ward and Police Divisions. Using coordinates, Analysis and prediction of the crimes can further be identified.

These steps will further improve crime prevention, resource allocation, and public safety in Tucson.