The following visualisations depict the extent to which citizens were brutalised by Police Departments across states in the USA, between the years 2013 to 2019. (Data source: https://mappingpoliceviolence.org/)
Majority of cases did not have producible body camera footage.
Out of all races, black civilians have the lowest proportion of armed civilians, yet the rate at which black civilians are killed is higher than the rate at which other races are killed. [Note: These rates are calculated relative to the population figures of each race]. Nonetheless, by carrying out further hypothesis tests, we would be able to determine if these differences in proportions are significant or not.
---
title: "Police Brutality in USA (Aggregated Across 2013-2019)"
author: "Bhargav Rele"
output:
flexdashboard::flex_dashboard:
source_code: embed
---
```{r global, include=FALSE}
library(readr)
library(magrittr)
library(dplyr)
library(tidyr)
library(knitr)
library(extrafont)
library(devtools)
library(ggmap)
library(forcats)
library(classInt)
library(lubridate)
library(classInt)
library(infotheo)
library(plotly)
library(ggplot2)
library(readxl)
pd_killings <- read_excel("MPVDatasetDownload.xlsx",sheet=2)
state_killings <- read_excel("MPVDatasetDownload.xlsx",sheet=3)
police_killings <- read_excel("MPVDatasetDownload.xlsx",sheet=1)
police_killings$`Victim's race` <- police_killings$`Victim's race` %>%
factor(levels=c(unique(police_killings$`Victim's race`)))
police_killings$`Victim's race collapsed` <- fct_collapse(police_killings$`Victim's race`,
Black = "Black",
Hispanic="Hispanic",
White="White",
Other=c("Unknown Race",
"Unknown race",
"Pacific Islander",
"Native American",
"Asian"))
police_killings$City <- police_killings$City %>% factor(levels=c(unique(police_killings$City)))
pd_killings$City <- pd_killings$City %>% factor(levels=c(unique(pd_killings$City)))
pd_killings$State <- pd_killings$State %>% factor(levels=c(unique(pd_killings$State)))
police_killings$`Unarmed` <- police_killings$`Unarmed` %>%
factor(levels=c(unique(police_killings$`Unarmed`)))
police_killings$`Unarmed collapsed` <- fct_collapse(police_killings$`Unarmed`,
Armed = c("Allegedly Armed","Vehicle"),
Unarmed=c("Unarmed","Unclear"))
police_killings$`Body Camera (Source: WaPo)` <- police_killings$`Body Camera (Source: WaPo)` %>%
factor(levels=c(unique(police_killings$`Body Camera (Source: WaPo)`)))
police_killings$`Body Camera collapsed` <- fct_collapse(police_killings$`Body Camera (Source: WaPo)`,
`No Body Cam`=c("no","No","Bystander Video","Surveillance Video"),
`Body Cam` = "Yes")
state_killings$State <- state_killings$State %>% factor(levels=c(unique(state_killings$State)))
```
Police Brutality across All Races
=====================================
The following visualisations depict the extent to which citizens were brutalised by Police Departments across states in the USA, between the years 2013 to 2019. (Data source: https://mappingpoliceviolence.org/)
Column
-------------------------------------
### Proportion of Unarmed Victims that have been killed
```{r}
pd_killings_info <- pd_killings %>% select(c(1:2,38))
police_killings_info <- police_killings %>% select(c(8,29))
pd_killings_group <- pd_killings_info %>% group_by(State,City) %>%
summarise(avg_violent_crime_rate=mean(`Violent Crime Rate`))
police_killings_group <- police_killings_info %>% group_by(City,`Unarmed collapsed`) %>% summarise(n=n())
killings_by_city <- inner_join(pd_killings_group,police_killings_group, by="City")
killings_by_city <- killings_by_city %>% mutate(freq=n/sum(n))
killings_by_city <- killings_by_city %>% as.data.frame()
killings_by_city <- killings_by_city[order(-killings_by_city$avg_violent_crime_rate),]
plot_ly(killings_by_city,color=~`Unarmed collapsed`,colors = c("grey56", "red")) %>%
add_trace(x=~freq,y=~State,type="bar",opacity=0.7) %>%
layout(barmode = "stack",
xaxis=list(zeroline=FALSE,title="Proportion of Victims"),
yaxis=list(zeroline=FALSE,title="States (Ascending Order by Average Violent Crime Rate)",categoryarray = ~State,
categoryorder = "array"))
```
Column
-------------------------------------
### Killings/10k Arrests & Violent Crime Rates for each PD
```{r}
plot_ly(pd_killings,y=~`Killings by Police per 10k Arrests`,x=~`Violent Crime Rate`,
type="scatter",marker = list(size = 10,
color = 'rgba(255, 182, 193, .9)',
line = list(color = 'rgba(152, 0, 0, .8)',
width = 2)),text=~PD) %>%
layout(xaxis=list(zeroline=FALSE,title="Violent Crime Rate for each Police Department"),
yaxis=list(zeroline=FALSE,title="No. of Victims Killed/10k arrests"))
```
### Proportion of Cases where Body Cam Footage was recorded
```{r}
police_killings_1 <- police_killings %>% group_by(`Unarmed collapsed`,`Body Camera collapsed`) %>%
summarise(n=n())
police_killings_1 <- na.omit(police_killings_1)
police_killings_1 <- police_killings_1 %>% mutate(freq=n/sum(n))
plot_ly(police_killings_1,color=~`Body Camera collapsed`,colors = c("red","grey56")) %>%
add_trace(x=~`Unarmed collapsed`,y=~freq,type="bar",marker=list(line = list(color = 'rgb(8,48,107)',width = 1.75)),opacity=0.7) %>%
layout(barmode = "stack",
xaxis=list(zeroline=FALSE,title="Armed/Unarmed Status of Victim"),
yaxis=list(zeroline=FALSE,title="Proportion of Cases"))
```
Police Brutality of Black Victims
=====================================
Column
-------------------------------------
### Rate at which Black Victims are Killed
```{r}
state_killings_1 <- state_killings %>% mutate(`Rate (Other People)`=(((`# People Killed`-`# Black people killed`)/
(Population-`African-American Alone`))*(1000000/7)))
plot_ly(state_killings_1,y=~`Rate (Black People)`,x=~State,type="bar",name="Rate for Black Victims",opacity=0.7) %>%
add_trace(y=~`Rate (Other People)`,type="bar",name="Rate for All Other Races",opacity=0.7) %>%
layout(barmode="group",
xaxis=list(zeroline=FALSE,title="State"),
yaxis=list(zeroline=FALSE,title="Rate (calculated relative to population of Race)"))
```
Column
-------------------------------------
### Proportion of Victims Armed & Unarmed, by Race
```{r}
cc <- count(police_killings,`Unarmed collapsed`,`Victim's race collapsed`)
cc2 <- left_join(cc, count(cc, `Victim's race collapsed`, wt = n, name = 'nn'))
cc2 %>%
mutate(prop = n / nn) %>%
plot_ly(y = ~prop, color = ~`Unarmed collapsed`,colors = c("grey56","red")) %>%
add_bars(x=~`Victim's race collapsed`,marker=list(line = list(color = 'rgb(8,48,107)',width = 1.75)),opacity=0.7) %>%
layout(barmode = "stack",
xaxis=list(zeroline=FALSE,title="Race of Victim"),
yaxis=list(zeroline=FALSE,title="Proportion of Victims"))
```
### Discussions
- Out of all deceased victims in our dataset, there is an alarming proportion of unarmed victims.
- The proportion of unarmed civilians that are being killed does not seem to have a strong posititve relationship with a police department's perception of crime rates within its district.
- Majority of cases did not have producible body camera footage.
- Out of all races, black civilians have the lowest proportion of armed civilians, yet the rate at which black civilians are killed is higher than the rate at which other races are killed. [Note: These rates are calculated relative to the population figures of each race]. Nonetheless, by carrying out further hypothesis tests, we would be able to determine if these differences in proportions are significant or not.