setwd("~/Desktop/hatecrimes")
library(tidyr)
library(dplyr)
## 
## Attaching package: 'dplyr'
## 
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## 
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(ggplot2)
library(knitr)
library(ggthemes)
library(RColorBrewer)
crimelocation=read.csv("CrimeLocation.csv")
statecrimeperson=read.csv("StateCrimePerson.csv")
statecrimeproperty=read.csv("StateCrimeProperty.csv")
crimesagainstpersonsethnicity=read.csv("CrimesAgainstPersonsEthnicity.csv")
crimesagainstpersonsrace=read.csv("CrimesAgainstPersonsRace.csv")
crimesagainstpropertyethnicity=read.csv("CrimesAgainstPropertyEthnicity.csv")
crimesagainstpropertyrace=read.csv("CrimesAgainstPropertyRace.csv")

About the Data Set

We obtained our data from the FBI public data repository, specifically the data that we are using is dealing with domestic hate crimes against persons, ethnic groups and races. The following tables sheds light on statistics and trends as seen in the original data sets.

Crime Location by Total Incidents Reported

ggplot(crimelocation, aes(Location, Total.Incidents)) + geom_bar(stat = "identity",fill= "dodgerblue3",colour="black") + theme(axis.text.x = element_text(angle = 90)) + ylab("Total Incidents") + xlab("Location") +ggtitle("Locations of Hate Crimes") + coord_flip() + scale_y_continuous(limits=c(0,2000), breaks=seq(0,2000,100), expand = c(0, 0))

Summary:

This graph uses a data set obtained from the FBI which contains data relevant to domestic hate crimes. This particular graph sheds light on which general locations are most commonly associated with hate crimes against individuals. Of the multitude of locations the ones that show the highest frequency of attacks are peoples residences, parking garages and the other category. Referencing these high frequency occurances against the others in the graph and you can see that when you are in a private setting like your home or a parking garage you are more at risk for being the target of a hate crime as compared to more public locations.

Persons effected by Hate Crimes per State, Aggravated & Simple

assaulttype=statecrimeperson[,c(1,5,6)] %>% gather(Assault.Type,Count,2:3)
assaulttype[,2]=gsub(".Assault","",as.character(assaulttype[,2]))


ggplot(assaulttype,aes(Assault.Type,Count))+geom_bar(stat="identity",position="dodge")+facet_wrap(~State,nrow=10,scales="free")

Summary:

These graps above show which states have the highest degree of assaults both simple and aggravated reported against persons. Here you can see if there are correlations between simple and aggravated assaults within the data. Also, I want to note that some states have no records of assaults motivated by hate crimes, this shows that reporting might not be taking place or that local departments are not keeping records of these incidents and relaying them to the FBI.

Property effected by Hate Crimes per State

names(statecrimeproperty)[4]="Larceny.Theft"
names(statecrimeproperty)[5]="Motor.Vehicle.Theft"
names(statecrimeproperty)[7]="Destruction.Damage.Vandalism"

statecrimeproperty$Total.PropertyCrimes = statecrimeproperty$Robbery + statecrimeproperty$Burglary + statecrimeproperty$Larceny.Theft + statecrimeproperty$Motor.Vehicle.Theft + statecrimeproperty$Arson + statecrimeproperty$Destruction.Damage.Vandalism + statecrimeproperty$Other

ggplot(statecrimeproperty, aes(State,Total.PropertyCrimes)) + geom_bar(stat = "identity",fill="dodgerblue3",colour="black") + theme(axis.text.x = element_text(angle = 90)) +ylab("Total Property Crimes") +ggtitle("Property Effected by Hate Crimes") + scale_y_continuous(limits=c(0,400), breaks=seq(0,400,50), expand = c(0, 0))

Summary:

This graph shows the total number of property crimes per state with hate crimes as being the motivator. The property crimes category on the y-axis includes such crimes as: robbery, burglary, larceny & theft, motor vehicle theft, arson, and destruction or damage to property. As we look at the information, we can see that their is a slight correlation between the states size and the propensity of property crimes reported. It appears that larger, more urban states have a higher degree of property crimes against peoples residences. Further research would be helpful to shed light to answer the question pertaining to why states have higher rates of property crimes. Referencing Motor Vehicle records as well as local crime and census records would help point to a cause in the these trends of hate crimes against property.

Races & Crimes Against Property

raceproperty=crimesagainstpropertyrace[,c(1,2,3,8)]
names(raceproperty)
## [1] "Crimes.Against.Property.by.Race" "White"                          
## [3] "Black.or.African.American"       "Unknown.Race"
names(raceproperty)[1]="Crimes.Against.Property.by.Race"
names(raceproperty)[2]="White"
names(raceproperty)[3]="Black.or.African.American"
names(raceproperty)[4]="Unknown.Race"

raceproperty=raceproperty %>% gather(race.property, Count,White:Unknown.Race)

levels(raceproperty$race.property)=c("White", "Black", "Unknown")

levels(raceproperty$Crimes.Against.Property.by.Race)=c("Arson", "Burglary", "destructionORdamageORvandalism", "Larceny Theft", "Motor Vehicle Theft", "Other", "Robbery" )

ggplot(raceproperty, aes(y=Count, x=race.property)) + geom_bar(stat="identity",position="dodge")+facet_wrap(~Crimes.Against.Property.by.Race,nrow=2,scales="free") + xlab("Race")

Summary:

These multiple bar charts are showing the amount of crimes against property committed among the races of white, black, and unknown. The crimes against property that are charted include: arson, burglary, destruction/damage/vandalism, larceny theft, motor vehicle theft, other, and robbery. The most committed crime is destruction/damage/vandalism followed by larceny theft and robbery. The crime that was committed the least was motor vehicle theft, which totaled only six occurrences. The crimes most committed by each race were: white (“destruction/damage/etc.”), black (“robbery”, and unknown (“destruction/damage/etc.”). The purpose of this graph is to compare the crimes against property among three different races to see if being a specific race has any correlation with a certain property crime.