Final Project

Nearby Facts & Figures Crime - Crime Data Analysis in County of Maryland

Maryland Crime map

Source: Scout

Introduction

  1. Intro (at the beginning of the markdown document): The topic of the data, any variables included, what kind of variables they are, where the data came from and how you cleaned it up (be detailed and specific, using proper terminology where appropriate). Attempt to discover HOW the data was collected – describe the methodology, or state clearly that there is no ReadMe file with that information. Be sure to explain why you chose this topic and dataset – what meaning does it have for you?

Violent Crime & Property Crime by County: 1975 to Present - Updated May 23, 2022

Rows 1,104 Columns 38

https://opendata.maryland.gov/Public-Safety/Violent-Crime-Property-Crime-by-County-1975-to-Pre/jwfa-fdxs/about_data

I have been an immigrant to Maryland for over ten years now. Fortunately, my town is very safe, and I have heard very little about violent crimes and thefts, but that doesn’t mean there are none. Almost daily, my neighborhood app alerts me to minor offenses, and I have even had my belongings stolen from a mall in Montgomery County. Crime is closer than we expected. For the final data, I was thinking about the data I used for the project, but I wanted to use data from my neighborhood, and that’s how I came across this data. I used crime records from the state of Maryland’s publicly available data from 1975-2020 and dug into the data to see what kind of crime trends existed. The values on the data are “JURISDICTION”,“YEAR”,“POPULATION”, “MURDER”, “RAPE”, “ROBBERY” , “AGG_ASSAULT”, “BandE”, “LARCENY_THEFT”, “MV_THEFT”, “GRAND_TOTAL”, “VIOLENT_CRIME_TOTAL”, “VIOLENT_CRIME_PERCENT”, “PROPERTY_CRIME_TOTALS” “PROPERTY_CRIME_PERCENT” , “OVERALL_CRIME_RATE_PER_100000_PEOPLE”, “VIOLENT_CRIME_RATE_PER_100000_PEOPLE”, “PROPERTY_CRIME_RATE_PER_100000_PEOPLE”, “MURDER_PER_100000_PEOPLE”, “RAPE_PER_100000_PEOPLE”, “ROBBERY_PER_100000_PEOPLE”, “AGG_ASSAULT_PER_100000_PEOPLE”, “BE_PER_100000_PEOPLE” “LARCENY_THEFT_PER_100000_PEOPLE”, “MV_THEFT_PER_100000_PEOPLE” and 13 more variables.

I had learned the delights of data cleaning in the Health 500 cities assignment, and I would have loved to take advantage of that, but it was not necessary for this data. This data was highly organized and much easier to handle than the data used in my projects. In the limited time available for this assignment, it was decided to remove the difference rates from the previous year’s data so they were not used. The data was taken from the Maryland State Police’s annual Uniform Crime Reports and compiled by the Governor’s Office of Crime Control and Prevention (GOCCP). The data is characterized not only by the number of crimes but also by the rate of crimes per 100,000 population in county units, which makes it very easy to compare (handle) the data for each area.

Get the Data

library(tidyverse)
library(tidyr)
setwd("D:/Data 110/final project")
crime <- read_csv("Violent_Crime___Property_Crime_by_County__1975_to_Present_20240425.csv")

Clean values - eliminate not use values

library(dplyr)

crime2 <- crime |>
  select(-VIOLENT_CRIME_PERCENT_CHANGE, -PROPERTY_CRIME_PERCENT_CHANGE, -VIOLENT_CRIME_RATE_PERCENT_CHANGE_PER_100000_PEOPLE,- VIOLENT_CRIME_RATE_PERCENT_CHANGE_PER_100000_PEOPLE, -PROPERTY_CRIME_RATE_PERCENT_CHANGE_PER_100000_PEOPLE, -MURDER_RATE_PERCENT_CHANGE_PER_100000_PEOPLE, -RAPE_RATE_PERCENT_CHANGE_PER_100000_PEOPLE, -ROBBERY_RATE_PERCENT_CHANGE_PER_100000_PEOPLE, -AGG_ASSAULT_RATE_PERCENT_CHANGE_PER_100000_PEOPLE, -BE_RATE_PERCENT_CHANGE_PER_100000_PEOPLE, -LARCENY_THEFT_RATE_PERCENT_CHANGE_PER_100000_PEOPLE, -MV_THEFT_RATE_PERCENT_CHANGE_PER_100000_PEOPLE,-PERCENT_CHANGE, -OVERALL_PERCENT_CHANGE_PER_100000_PEOPLE)

Explore data

head(crime2)
## # A tibble: 6 × 25
##   JURISDICTION     YEAR POPULATION MURDER  RAPE ROBBERY AGG_ASSAULT BandE
##   <chr>           <dbl>      <dbl>  <dbl> <dbl>   <dbl>       <dbl> <dbl>
## 1 Allegany County  1975      79655      3     5      20         114   669
## 2 Allegany County  1976      83923      2     2      24          59   581
## 3 Allegany County  1977      82102      3     7      32          85   592
## 4 Allegany County  1978      79966      1     2      18          81   539
## 5 Allegany County  1979      79721      1     7      18          84   502
## 6 Allegany County  1980      80461      2    12      26          79   541
## # ℹ 17 more variables: LARCENY_THEFT <dbl>, MV_THEFT <dbl>, GRAND_TOTAL <dbl>,
## #   VIOLENT_CRIME_TOTAL <dbl>, VIOLENT_CRIME_PERCENT <dbl>,
## #   PROPERTY_CRIME_TOTALS <dbl>, PROPERTY_CRIME_PERCENT <dbl>,
## #   OVERALL_CRIME_RATE_PER_100000_PEOPLE <dbl>,
## #   VIOLENT_CRIME_RATE_PER_100000_PEOPLE <dbl>,
## #   PROPERTY_CRIME_RATE_PER_100000_PEOPLE <dbl>,
## #   MURDER_PER_100000_PEOPLE <dbl>, RAPE_PER_100000_PEOPLE <dbl>, …
summary(crime2)
##  JURISDICTION            YEAR        POPULATION          MURDER      
##  Length:1104        Min.   :1975   Min.   :  16200   Min.   :  0.00  
##  Class :character   1st Qu.:1986   1st Qu.:  33049   1st Qu.:  1.00  
##  Mode  :character   Median :1998   Median :  90075   Median :  3.00  
##                     Mean   :1998   Mean   : 213571   Mean   : 19.79  
##                     3rd Qu.:2009   3rd Qu.: 237562   3rd Qu.:  7.00  
##                     Max.   :2020   Max.   :1062595   Max.   :353.00  
##       RAPE           ROBBERY         AGG_ASSAULT          BandE        
##  Min.   :  0.00   Min.   :    0.0   Min.   :   11.0   Min.   :   32.0  
##  1st Qu.:  9.00   1st Qu.:   17.0   1st Qu.:  108.0   1st Qu.:  256.0  
##  Median : 21.00   Median :   48.0   Median :  257.5   Median :  609.5  
##  Mean   : 67.26   Mean   :  584.4   Mean   :  836.5   Mean   : 1866.4  
##  3rd Qu.: 46.00   3rd Qu.:  186.2   3rd Qu.:  545.5   3rd Qu.: 1230.0  
##  Max.   :754.00   Max.   :12408.0   Max.   :10536.0   Max.   :18604.0  
##  LARCENY_THEFT        MV_THEFT        GRAND_TOTAL    VIOLENT_CRIME_TOTAL
##  Min.   :   91.0   Min.   :    2.0   Min.   :  152   Min.   :   21.0    
##  1st Qu.:  679.8   1st Qu.:   43.0   1st Qu.: 1116   1st Qu.:  140.0    
##  Median : 1813.0   Median :  125.5   Median : 2840   Median :  323.0    
##  Mean   : 5559.2   Mean   : 1000.9   Mean   : 9934   Mean   : 1507.9    
##  3rd Qu.: 3766.2   3rd Qu.:  413.2   3rd Qu.: 6042   3rd Qu.:  743.8    
##  Max.   :46750.0   Max.   :18482.0   Max.   :96243   Max.   :22006.0    
##  VIOLENT_CRIME_PERCENT PROPERTY_CRIME_TOTALS PROPERTY_CRIME_PERCENT
##  Min.   : 4.10         Min.   :  126.0       Min.   :66.30         
##  1st Qu.: 9.50         1st Qu.:  963.8       1st Qu.:84.60         
##  Median :12.60         Median : 2520.0       Median :87.40         
##  Mean   :12.74         Mean   : 8426.5       Mean   :87.26         
##  3rd Qu.:15.40         3rd Qu.: 5341.5       3rd Qu.:90.50         
##  Max.   :33.70         Max.   :74665.0       Max.   :95.90         
##  OVERALL_CRIME_RATE_PER_100000_PEOPLE VIOLENT_CRIME_RATE_PER_100000_PEOPLE
##  Min.   :  788.7                      Min.   :  89.1                      
##  1st Qu.: 2437.7                      1st Qu.: 267.1                      
##  Median : 3214.4                      Median : 376.1                      
##  Mean   : 3688.5                      Mean   : 486.2                      
##  3rd Qu.: 4323.1                      3rd Qu.: 546.4                      
##  Max.   :13513.3                      Max.   :3029.7                      
##  PROPERTY_CRIME_RATE_PER_100000_PEOPLE MURDER_PER_100000_PEOPLE
##  Min.   :  653.8                       Min.   : 0.000          
##  1st Qu.: 2123.8                       1st Qu.: 1.500          
##  Median : 2828.9                       Median : 3.300          
##  Mean   : 3202.3                       Mean   : 5.546          
##  3rd Qu.: 3832.0                       3rd Qu.: 5.800          
##  Max.   :11177.4                       Max.   :58.300          
##  RAPE_PER_100000_PEOPLE ROBBERY_PER_100000_PEOPLE AGG_ASSAULT_PER_100000_PEOPLE
##  Min.   : 0.00          Min.   :   0.00           Min.   :  56.1               
##  1st Qu.:16.90          1st Qu.:  36.77           1st Qu.: 188.6               
##  Median :23.80          Median :  66.70           Median : 277.8               
##  Mean   :27.15          Mean   : 123.19           Mean   : 330.3               
##  3rd Qu.:33.00          3rd Qu.: 108.70           3rd Qu.: 416.3               
##  Max.   :99.80          Max.   :1692.80           Max.   :1619.5               
##  BE_PER_100000_PEOPLE LARCENY_THEFT_PER_100000_PEOPLE
##  Min.   :  91.5       Min.   : 472.2                 
##  1st Qu.: 495.2       1st Qu.:1463.0                 
##  Median : 694.3       Median :1934.3                 
##  Mean   : 789.5       Mean   :2169.9                 
##  3rd Qu.: 991.1       3rd Qu.:2667.4                 
##  Max.   :3365.4       Max.   :7348.6                 
##  MV_THEFT_PER_100000_PEOPLE
##  Min.   :  10.5            
##  1st Qu.:  97.7            
##  Median : 143.7            
##  Mean   : 242.9            
##  3rd Qu.: 269.1            
##  Max.   :2184.1

Check value names

names(crime2)
##  [1] "JURISDICTION"                         
##  [2] "YEAR"                                 
##  [3] "POPULATION"                           
##  [4] "MURDER"                               
##  [5] "RAPE"                                 
##  [6] "ROBBERY"                              
##  [7] "AGG_ASSAULT"                          
##  [8] "BandE"                                
##  [9] "LARCENY_THEFT"                        
## [10] "MV_THEFT"                             
## [11] "GRAND_TOTAL"                          
## [12] "VIOLENT_CRIME_TOTAL"                  
## [13] "VIOLENT_CRIME_PERCENT"                
## [14] "PROPERTY_CRIME_TOTALS"                
## [15] "PROPERTY_CRIME_PERCENT"               
## [16] "OVERALL_CRIME_RATE_PER_100000_PEOPLE" 
## [17] "VIOLENT_CRIME_RATE_PER_100000_PEOPLE" 
## [18] "PROPERTY_CRIME_RATE_PER_100000_PEOPLE"
## [19] "MURDER_PER_100000_PEOPLE"             
## [20] "RAPE_PER_100000_PEOPLE"               
## [21] "ROBBERY_PER_100000_PEOPLE"            
## [22] "AGG_ASSAULT_PER_100000_PEOPLE"        
## [23] "BE_PER_100000_PEOPLE"                 
## [24] "LARCENY_THEFT_PER_100000_PEOPLE"      
## [25] "MV_THEFT_PER_100000_PEOPLE"

Maryland population and Crime grand total

MD population and Crime
MD population and Crime

Graph in Tableau

https://public.tableau.com/app/profile/sayaka.berkley/viz/Fainalproject/Barandlinechart?publish=yes

While the Maryland population is increasing, the number of crimes is decreasing. I will explore the reasons for this shift in data.

Lets’see crime type trend top 10 population counties

Top 10 population county in Maryland

“Montgomery County”, “Prince George’s County”, “Baltimore City”, “Baltimore County”, “Anne Arundel County”, “Howard County”, “Frederick County”, “Harford County”, “Carroll County”, “Charles County”

Streamgraph of criminal case numbers by selected counties

Meet number of crimes of counties

library(streamgraph)
library(tidyverse)

counties <- crime2 |>
  filter(JURISDICTION %in% c("Montgomery County", "Prince George's County",
                             "Baltimore City", "Baltimore County",
                             "Anne Arundel County", "Howard County",
                             "Frederick County", "Harford County",
                             "Carroll County", "Charles County")) |>
  filter(YEAR >= 1975, YEAR <= 2020)


# Create streamgraph using highcharter
plot1 <- counties |>
  streamgraph(key = "JURISDICTION", value ="GRAND_TOTAL", date = "YEAR", offset = "zero") |>
  sg_fill_brewer("YlOrRd")

plot1
## Warning in widget_html(name, package, id = x$id, style = css(width =
## validateCssUnit(sizeInfo$width), : streamgraph_html returned an object of class
## `list` instead of a `shiny.tag`.
## Warning: `bindFillRole()` only works on htmltools::tag() objects (e.g., div(),
## p(), etc.), not objects of type 'list'.

This is a “streamgraph” function- cannot put title, subtitle, caption At this step, I tried eliminating the NA value using “!is.na.” However, no number of times have I tried, and I got an error and assumed that there was no NA value.

Is Maryland is less or more violence?

library(dplyr)
library(ggplot2)

mean_crime_rate <- counties |>
  group_by(JURISDICTION) |>
  summarise(mean_overall_crime_rate = mean(OVERALL_CRIME_RATE_PER_100000_PEOPLE))


sum_murders_by_year <- counties |>
  group_by(YEAR) |>
  summarise(total_murders = sum(MURDER))


plot2 <- crime_rate_plot <- counties |>
  ggplot(aes(x = YEAR)) +
  geom_line(aes(y = VIOLENT_CRIME_RATE_PER_100000_PEOPLE, color = "Violent crime")) +
  geom_line(aes(y = PROPERTY_CRIME_RATE_PER_100000_PEOPLE, color = "Property crime")) +  
  facet_wrap(~JURISDICTION, scales = "free_y") +
  labs(title = "Crime Rates per 100,000 People by Jurisdiction",
       subtitle = "Top 10 population couties in MD",
       y = "Rate per 100,000 People",
       caption = "Source: Maryaland crimes",
       color = "Crime Type") +
  theme_minimal()+
 theme(panel.background = element_rect(fill = "gray90"))
plot2

The trend of Maryland crimes are more property crimes rates are higher than violent crime rate. More comments on the plot 3.

library(dplyr)
library(ggplot2)

# Calculate the average property and violent crime percentages for each jurisdiction
average_crime_percentages <- counties |>
  group_by(JURISDICTION) |>
  summarise(
    avg_property_crime_percent = mean(PROPERTY_CRIME_PERCENT),
    avg_violent_crime_percent = mean(VIOLENT_CRIME_PERCENT)
  )


# Plot the average crime percentages
plot3 <- crime_percentages_plot <- ggplot(average_crime_percentages, aes(x = JURISDICTION)) +
  geom_bar(aes(y = avg_property_crime_percent, fill = "Property Crime Percent"), stat = "identity", position = "dodge", color = "brown1", alpha = 0.5) +
  geom_bar(aes(y = avg_violent_crime_percent, fill = "Violent Crime Percent"), stat = "identity", position = "dodge", color = "cyan3", alpha =0.5) +
  labs(title = "Average Crime Percentages by Jurisdiction",
       subtitle = "Top 10 population counties in MD",
       caption = "Source: Maryland Crimes",
       y = "Average Percentage",
       fill = "Crime Type") +
  theme_minimal() +
  coord_flip()+
  theme(panel.background = element_rect(fill = "antiquewhite2"))
plot3

This graph further improves the above chart for easier comparison between property and violent crimes. Plot 2 above shows the rate of crimes per 100,000 population, and plot 3 shows Average Crime Percentages by selected counties. The two tables clearly show that property crimes are far more common than violent crimes. This is one reason for the relatively low level of public safety.

Crime statistics sorted by total cases

# Filter the data for the specified counties
filtercounty2 <- crime2[crime2$JURISDICTION %in% c("Montgomery County", "Prince George's County",
                                                   "Baltimore City", "Baltimore County", 
                                                   "Anne Arundel County", "Howard County",
                                                   "Frederick County", "Harford County", 
                                                   "Carroll County", "Charles County"), ]

filtercounty2$GRAND_TOTAL <- rowSums(filtercounty2[, c("MURDER", "RAPE", "ROBBERY", "AGG_ASSAULT", "BandE", "LARCENY_THEFT", "MV_THEFT")])


filtered_df <- filtercounty2[order(-filtercounty2$GRAND_TOTAL), ]


melted_df <- reshape2::melt(filtered_df, id.vars = "JURISDICTION", measure.vars = c("MURDER", "RAPE", "ROBBERY", "AGG_ASSAULT", "BandE", "LARCENY_THEFT", "MV_THEFT"))


plot4 <-ggplot(melted_df, aes(x = JURISDICTION, y = value, fill = variable)) +
  geom_bar(stat = "identity", position = "fill", alpha = 0.8) +
  scale_fill_brewer(palette = "Set3") +  
  labs(title = "Crime Statistics Bar Plot for Selected Counties Sorted by Total Cases", y = "Proportion", x = "Jurisdiction",
       subtitle = "1975-2020",
       caption = "Source:MD crimes") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1), legend.position = "bottom") +
   theme_bw()


plot4

Larceny theft is the most common crime in any county. Property crimes are where a person illegally takes and carries away the property of another without permission. This is a particular point to be aware of, as it can happen in any country.

Alluvium of selected counties with crimes

library(ggalluvial)
library(dplyr)

filtercounty <- c("Montgomery County", "Prince George's County", "Baltimore City",
                 "Baltimore County", "Anne Arundel County", "Howard County",
                 "Frederick County", "Harford County", "Carroll County", "Charles County")

filtered_crime2 <- crime2 %>%
  filter(JURISDICTION %in% filtercounty)  # Filter based on JURISDICTION

ggalluv <- ggplot(filtered_crime2,  # Use filtered data
  aes(x = YEAR, y = OVERALL_CRIME_RATE_PER_100000_PEOPLE, alluvium = JURISDICTION)) +
  theme_bw() +
  geom_alluvium(aes(fill = JURISDICTION),  # Use JURISDICTION for color
                color = "white", width = .1, alpha = .8, decreasing = FALSE) +
  scale_fill_brewer(palette = "Paired") +  # Color palette for jurisdictions
  scale_x_continuous(lim = c(1975, 2020)) +
  ggtitle("Crimes per 100,000 people in Selected Maryland Jurisdictions (1975-2020)") +
  ylab("Number of crimes")+
  theme(panel.background = element_rect(fill = "antiquewhite2"))
ggalluv

The table summarizes the shifting trends in the number of crimes by county. As mentioned in the first image, it is clear that the overall number of crimes is on the decline.

Multiple regressional model

I tested whether there is a correlation between population and the type and location of crime.

filtercounty2$jurisdiction <- as.factor(filtercounty2$JURISDICTION)

lm_model <- lm(POPULATION ~ jurisdiction + YEAR + MURDER + RAPE + ROBBERY + AGG_ASSAULT + LARCENY_THEFT + MV_THEFT, data = filtercounty2)

summary(lm_model)
## 
## Call:
## lm(formula = POPULATION ~ jurisdiction + YEAR + MURDER + RAPE + 
##     ROBBERY + AGG_ASSAULT + LARCENY_THEFT + MV_THEFT, data = filtercounty2)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -168736  -18116    4457   20389  149167 
## 
## Coefficients:
##                                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                        -8.741e+06  3.628e+05 -24.098  < 2e-16 ***
## jurisdictionBaltimore City          3.034e+05  3.465e+04   8.757  < 2e-16 ***
## jurisdictionBaltimore County        2.790e+05  1.321e+04  21.125  < 2e-16 ***
## jurisdictionCarroll County         -3.747e+05  1.389e+04 -26.979  < 2e-16 ***
## jurisdictionCharles County         -3.935e+05  1.349e+04 -29.179  < 2e-16 ***
## jurisdictionFrederick County       -3.282e+05  1.320e+04 -24.859  < 2e-16 ***
## jurisdictionHarford County         -3.023e+05  1.280e+04 -23.619  < 2e-16 ***
## jurisdictionHoward County          -2.794e+05  1.192e+04 -23.444  < 2e-16 ***
## jurisdictionMontgomery County       3.773e+05  1.278e+04  29.515  < 2e-16 ***
## jurisdictionPrince George's County  3.294e+05  1.488e+04  22.140  < 2e-16 ***
## YEAR                                4.638e+03  1.797e+02  25.809  < 2e-16 ***
## MURDER                             -1.471e+03  1.431e+02 -10.278  < 2e-16 ***
## RAPE                                4.658e+01  4.316e+01   1.079   0.2811    
## ROBBERY                             5.620e+01  5.304e+00  10.595  < 2e-16 ***
## AGG_ASSAULT                         3.302e+00  4.413e+00   0.748   0.4547    
## LARCENY_THEFT                      -6.612e+00  1.281e+00  -5.160 3.74e-07 ***
## MV_THEFT                            3.654e+00  2.077e+00   1.759   0.0792 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 44590 on 443 degrees of freedom
## Multiple R-squared:  0.9776, Adjusted R-squared:  0.9768 
## F-statistic:  1208 on 16 and 443 DF,  p-value: < 2.2e-16

The linear model suggests 97.76 percent of strong positive linear relationships between all variables. The p-value is pretty small- this regressional model correlates meaningfully with variables. The model also shows that property crime is more relevant than violent crime. Murder and Rape are not highly correlated with the population.

Baltimore City and Baltimore county - What happen on 1996?

As the previous charts have shown, Crime City = Baltimore explores why crime has fallen so dramatically.

library(highcharter)
## Registered S3 method overwritten by 'quantmod':
##   method            from
##   as.zoo.data.frame zoo
# Filter data for Baltimore City and Baltimore County from 1975 to 2016
baltimore_data <- crime2[(crime2$JURISDICTION %in% c("Baltimore City", "Baltimore County")) & (crime2$YEAR >= 1975 & crime2$YEAR <= 2020), ]


plot5 <- hchart(baltimore_data, "bubble", hcaes(x = YEAR, y = GRAND_TOTAL, size = GRAND_TOTAL, group = JURISDICTION)) |>
hc_title(text = "Total Number of Crimes in Baltimore from 1975 to 2016") |>
hc_caption(text = "MD Crimes 1975-2020",
align = "Right",
style= list(fontSize = "9px")) |>
hc_xAxis(title = list(text = "Year")) |>
hc_yAxis(title = list(text = "Count of Crimes")) |>
hc_add_theme(hc_theme_flat()) |>
hc_legend(title = list(text = "Baltimore City / Baltimore County"), align = "right",
verticalAlign = "top",
bubbleLegend = list(enabled = TRUE)) |>
hc_tooltip(pointFormat = "{point.jurisdiction}: {point.y} crimes in {point.x}")
plot5

Baltimore County government improved reporting a problem or requesting a service system instead of 911 by calling 311 in 1996. This is the first city in the United States in this system. The introduction of this system improved the prioritization of police intervention, and crime dropped dramatically. (Source: Washington post https://www.washingtonpost.com/archive/local/1996/10/03/baltimore-gets-311/8fbfed72-99be-4819-a1c5-42436fa38296/) Since the 1960s, aging buildings and the structural recession of major industries caused a population exodus from the city’s center, leading to the development of slums and a deterioration of public safety. In response, the city implemented a 30-year redevelopment plan, considered the pioneer of waterfront development. In particular, the Inner Harbor was completely revamped, and a number of leisure facilities were built along with industrial and trade facilities. The Inner Harbor is booming with a large shopping center, the Baltimore National Aquarium, one of the best in the U.S., and the Maritime Museum. On the other hand, the city center remains seriously hollowed out, and public safety has not improved much. In a recent study, Boston University students found reducing late-night alcohol sales curbed violent crimes significantly reduced per year. Source: BU School of public health https://www.bu.edu/sph/news/articles/2024/reducing-late-night-alcohol-sales-curbed-violent-crimes-by-23-per-year-in-a-baltimore-neighborhood/

Heatmap of selected counties by crime

Is there a political relationship between public safety and government? Find out if there are any changes in public safety as a result of the term of the state governor and whether public safety can be attributed to political matters.

library(highcharter)
library(dplyr)
library(RColorBrewer)

# Define year ranges
year_ranges <- list(
  c(1975, 1978),
  c(1979, 1987),
  c(1987, 1995),
  c(1995, 2003),
  c(2003, 2007),
  c(2007, 2015),
  c(2015, 2020)
)

filtercounty2 <- crime2[crime2$JURISDICTION %in% c("Montgomery County", "Prince George's County",
                                                   "Baltimore City", "Baltimore County", 
                                                   "Anne Arundel County", "Howard County",
                                                   "Frederick County", "Harford County", 
                                                   "Carroll County", "Charles County"), ]

filteredcrime2 <- filtercounty2 |>
  filter(YEAR %in% unlist(lapply(year_ranges, function(range) seq(range[1], range[2]))))


chartcrime <- filteredcrime2 |>
  group_by(YEAR, JURISDICTION) |>
  summarise(GRAND_TOTAL = sum(GRAND_TOTAL, na.rm = TRUE)) |>
  ungroup()
## `summarise()` has grouped output by 'YEAR'. You can override using the
## `.groups` argument.
min_total <- min(chartcrime$GRAND_TOTAL)
max_total <- max(chartcrime$GRAND_TOTAL)


plot6 <- highchart() |>
  hc_add_series(chartcrime, type = 'heatmap', hcaes(x = YEAR, y = JURISDICTION, value = GRAND_TOTAL), borderWidth = 1) |>
  hc_title(text = "Heatmap of Grand Total Crimes by Jurisdiction and Year") |>
  hc_xAxis(title = list(text = "Year"), categories = unique(chartcrime$YEAR)) |>
  hc_yAxis(title = list(text = "Jurisdiction"), categories = unique(chartcrime$JURISDICTION), reversed = TRUE) |>
  hc_colorAxis(stops = color_stops(n = 12, colors = c("#007bff", "#434a54", "#6c757d","#968a85", "#bab0ac","#dec3ba", 
 "#fffbbc", "#ffc107", "#ffa726",  "#d95b43",  "#c02942"))) |>
  hc_legend(enabled = TRUE) |>
  hc_plotOptions(series = list(turboThreshold = 0))

plot6

The crime peak was 1995 and decreasing the cases because the former Govenor Parris N. Glendening (1995-2003) focused on making Maryland neighborhoods and communities safe and secure. The governor innovated community policing and HotSpots, and one of the strongest anti-gun violence measure in the nation. These programs made decreased the crime rate in Maryland twice as fast as the national average. (Maryalnd Manual on-line: https://msa.maryland.gov/msa/mdmanual/08conoff/former/html/msa11536.html)

Maryland crimes are decreasing; How about gun crime?

Gun crime in MD
Gun crime in MD

https://public.tableau.com/app/profile/sayaka.berkley/viz/Overallcrimerateper100000people/Guncrimetrernd?publish=yes

While these security efforts by the former governor and the various counties (and Baltimore City) have been successful in improving public safety, the number of crimes has been surreptitiously rising: crimes committed with guns. This data is taken from Project 1, but the current situation is that the number of crimes has been gradually increasing since 2013, and according to information from other sources, it will continue to increase in 2018 and beyond. (There was a slight increase during the pandemic, but it seems to have been only a temporary phenomenon. Source: EFSGV Maryland Gun Deaths https://efsgv.org/state/maryland/

Essays

  1. Incorporate background research about this topic. This background information will include information you find in an article, website, or book. Please source this background information within the essay or if you have multiple sources, include a bibliography. I am not particular about the format of this bibliography. If you need help finding articles, I am happy to help you and/or show you how to search the MC Library Database.

This analysis examines crime in Maryland. Public data from 1975-2020 exhibits a decrease in basic crime costs, though gun violence is a developing situation. Property crimes are much more common than violent crimes. Baltimore City serves as an achievement story. Crime there has plummeted since the Nineteen Nineties, way to better-reporting structures and urban renewal initiatives. Former Governor Glendening’s guidelines, emphasizing network policing and gun management, also are credited for the statewide decline. The highlights: minor crimes arise even in supposedly safe regions. The analysis acknowledges statistics obstacles and explores potential hyperlinks between public protection and government guidelines. Interestingly, a program allowing non-emergency calls (311) to be directed successes as a Baltimore innovation. Maryland has made visible progress in recent years from public security improvement efforts, but it should urgently address the problem of the gradual increase in gun violence. It will also be a challenge to maintain these improved public safety measures in the future.

  1. What the visualization represents, any interesting patterns or surprises that arise within the visualization, and anything that could have been shown that you could not get to work or that you wished you could have included.

As mentioned from the first image, I was attracted to this data from the fact that the number of crimes is decreasing despite the population increase. Maryland has the highest household income in the nation, and fewer people are in financial (and social) trouble than in other states, which may be one reason for the relatively low level of violent crime. In addition, I considered using a map to visualize the data, although I did not include it in this data analysis because most classmates are Maryland residents; however, I could have included it in the crime rate.

`