HateCrimes

library(tidyverse) #tinytex::install_tinytex() #library(tinytex) setwd(“C:/Users/jman1/OneDrive/Documents//Data110 Folder”) hatecrimes <- read_csv(“hateCrimes2010.csv”) summary(hatecrimes)

names(hatecrimes) <- tolower(names(hatecrimes)) names(hatecrimes) <- gsub(” “,”“,names(hatecrimes)) head(hatecrimes) summary(hatecrimes)

hatecrimes2 <- hatecrimes |> select(county, year, ‘anti-black’, ‘anti-white’, ‘anti-jewish’, ‘anti-catholic’,‘anti-age*’,‘anti-islamic(muslim)’, anti-multi-religiousgroups, ‘anti-gaymale’, ‘anti-hispanic’, anti-otherethnicity/nationalorigin) |> group_by(county, year) head(hatecrimes2) dim(hatecrimes2) summary(hatecrimes2)

hatelong <- hatecrimes2 |> pivot_longer( cols = 3:12, names_to = “victim_cat”, values_to = “crimecount”)

    hatecrimplot <-hatelong |> 

ggplot(aes(year, crimecount))+ geom_point()+ aes(color = victim_cat)+ facet_wrap(~victim_cat) hatecrimplot view(hatecrimplot)

hatenew <- hatelong |> filter( victim_cat %in% c(“anti-black”, “anti-jewish”, “anti-gaymale”))|> group_by(year, county) |> arrange(desc(crimecount)) hatenew

plot2 <- hatenew |> ggplot() + geom_bar(aes(x=year, y=crimecount, fill = victim_cat), position = “dodge”, stat = “identity”) + labs(fill = “Hate Crime Type”, y = “Number of Hate Crime Incidents”, title = “Hate Crime Type in NY Counties Between 2010-2016”, caption = “Source: NY State Division of Criminal Justice Services”) plot2

plot3 <- hatenew |> ggplot() + geom_bar(aes(x=county, y=crimecount, fill = victim_cat), position = “dodge”, stat = “identity”) + labs(fill = “Hate Crime Type”, y = “Number of Hate Crime Incidents”, title = “Hate Crime Type in NY Counties Between 2010-2016”, caption = “Source: NY State Division of Criminal Justice Services”) plot3

counties <- hatenew |> group_by(year, county)|> summarize(sum = sum(crimecount)) |> arrange(desc(sum))

counties

counties2 <- hatenew |> group_by(county)|> summarize(sum = sum(crimecount)) |> slice_max(order_by = sum, n=5) counties2

plot4 <- hatenew |> filter(county %in% c(“Kings”, “New York”, “Suffolk”, “Nassau”, “Queens”)) |> ggplot() + geom_bar(aes(x=county, y=crimecount, fill = victim_cat), position = “dodge”, stat = “identity”) + labs(y = “Number of Hate Crime Incidents”, title = “5 Counties in NY with Highest Incidents of Hate Crimes”, subtitle = “Between 2010-2016”, fill = “Hate Crime Type”, caption = “Source: NY State Division of Criminal Justice Services”) plot4

nypop\(county <- gsub(" , New York", "", nypop\)county) nypop\(county <- gsub("County", "", nypop\)county) nypoplong <- nypop |> rename(county = county) |> gather(“year”, “population”, 2:8) nypoplong\(year <- as.double(nypoplong\)year) head(nypoplong)

nypoplong12 <- nypoplong |> filter(year == 2012) |> arrange(desc(population)) |> head(10) nypoplong12\(county<-gsub(" , counties12"",nypoplong12\)county) nypoplong12 view(nypoplong12)

counties12 <- counties |> filter(year == 2012) |> arrange(desc(sum)) counties12

datajoin <- counties12 |> full_join(nypoplong12, by=c(“county”, “year”)) datajoin

datajoinrate <- datajoin |> mutate(rate = sum/population*100000) |> arrange(desc(rate)) datajoinrate

dt <- datajoinrate[,c(“county”,“rate”)] dt

aggregategroups <- hatecrimes |> pivot_longer( cols = 4:44, names_to = “victim_cat”, values_to = “crimecount” ) unique(aggregategroups$victim_cat)

aggregategroups <- aggregategroups |> mutate(group = case_when( victim_cat %in% c(“anti-transgender”, “anti-gayfemale”, “anti-gendervictim_catendityexpression”, “anti-gaymale”, “anti-gay(maleandfemale”, “anti-bisexual”) ~ “anti-lgbtq”, victim_cat %in% c(“anti-multi-racialgroups”, “anti-jewish”, “anti-protestant”, “anti-multi-religousgroups”, “anti-religiouspracticegenerally”, “anti-buddhist”, “anti-hindu”, “anti-mormon”, “anti-sikh”, “anti-catholic”, “anti-islamic(muslim)”, “anti-atheism/agnosticism”, “anti-otherreligion”, “anti-easternorthodox(greek,russian,etc.)”, “anti-jehovahswitness”, “anti-otherchristian”) ~ “anti-religion”, victim_cat %in% c(“anti-asian”, “anti-arab”, “anti-non-hispanic”, “anti-white”, “anti-americanindian/alaskannative”, “anti-nativehawaiian/pacificislander”, “anti-otherrace”, “anti-hispanic”, “anti-otherethnicity/nationalorigin”) ~ “anti-ethnicity”, victim_cat %in% c(“anti-physicaldisability”, “anti-mentaldisability”) ~ “anti-disability”, victim_cat %in% c(“anti-female”, “anti-male”) ~ “anti-gender”, TRUE ~ “others”)) aggregategroups

lgbtq <- hatecrimes |> pivot_longer( cols = 4:44, names_to = “victim_cat”, values_to = “crimecount”) |> filter(victim_cat %in% c(“anti-transgender”, “anti-gayfemale”, “anti-gendervictim_catendityexpression”, “anti-gaymale”, “anti-gay(maleandfemale”, “anti-bisexual”)) lgbtq

Analysis of hatecrimes dataset in New York counties from 2010 to 2016. Simply looking at population numbers of the different counties doesn’t reveal the whole picture of hate crime frequency and trends. Adjusting for population size by instead looking at hate crime per 100k people is a more telling way to represent the data.

A positive aspect of the dataset is that it highlights many different demographic groups and has a large number of data points. One negative aspect is that it only includes hate crimes from 2010-2016, a wider range of time could be beneficial to accurately represent public change in attitude towards different demographic groups. The social justice movements following 2016 may have changed the types, frequency, and severity of different hate crimes. The datasets inclusion of only New York counties may not be representative of broader trends globally or nationally.

For this dataset, I’d be curious to look more into what sort of public events occur during time of increased hate crime towards specific demographic groups to better understand what leads to fluctuations in hate crime towards different populations. I would also like to research the sorts of interactions happening before these hate crimes occur to spot trends and potentially take steps to prevent them from occuring as often. It may be interesting to look into correlations between crimes against different groups to potentially reveal larger trends. For this dataset of New York state, it might also be interesting to compare counties with varying ethnic breakdowns to see whether hate crimes against those demographics differ.

One thing I would do to follow up from the data is to research into more datasets on hate crime in the U.S and compare them to other countries. Doing so, I would also ensure that the definitions of the categories are the same (e.g. violent crime defined in Italy is the same definition as in the U.S.)