Five Thirty Eight is a website that focuses on opinion poll analysis, politics,economics and sport blogging. This blog was founded by Nate Silver. This blog has covered a broad spectrum of subjects including politics, sports,science,economics and popular culture.
In this script, we will try to analyse the dataset on police deaths which were donated by 538. The police are important in a democratic society as they provide and protect the rule of law, thereby enhancing civic trust and maintaining social order.
## Warning: package 'tidyverse' was built under R version 3.3.2
## Warning: package 'highcharter' was built under R version 3.3.2
The number of deaths of police men were the highest in the year 1930. The number of police deaths per year decreases from 1930s onwards.The number of deaths in the first few years of the 70’s were pretty high. During the 80’s and the 90’s the number of police deaths went down.There is a sudden spike in 2001, which could suggest the law enforcement death count during the 9/11 attacks. There is another spike in 2007.
The number of police dog deaths were the highest in 2015. Police dogs are specifically trained to assist police and other law enforcement personnel in their work.They are mostly used for drug law enforcement operations and bomb diffusion.
Texas state leads in the number of police deaths overall.The state with the lowest police deaths is Northern Mariana Islands.
The number of police dogs dying has been increasing from the early 90’s. The police units are indispensible. From catching running suspects to bomb diffusion , they are one of the most important units in the police force.
Most police deaths have happened in the weekend. The death counts dip a bit on Wednesday.
Most of police deaths have occurred in the second half of the year.
human <- police %>% group_by(year,canine) %>% summarise(n=n()) %>% filter(canine=="FALSE")%>% select(year,n)
dog <- police %>% group_by(year,canine) %>% summarise(m=n()) %>% filter(canine=="TRUE") %>% select(year,m)
killed <-merge(human,dog)
The residual plots are not randomly distributed. For a linear model to be effective, these points have to be randomly distributed around the zero line.
The histogram plot is nearly normal. We need to have a normal distribution for a strong linear model.
The normality of the residual points is confirmed by the Q-Q plot.
summary(m1)
##
## Call:
## lm(formula = m ~ ., data = killed)
##
## Residuals:
## Min 1Q Median 3Q Max
## -8.1757 -2.1672 -0.1376 1.8064 13.0125
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -522.95096 105.48821 -4.957 1.29e-05 ***
## year 0.26936 0.05188 5.192 6.03e-06 ***
## n -0.04476 0.01972 -2.270 0.0286 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 3.973 on 41 degrees of freedom
## Multiple R-squared: 0.63, Adjusted R-squared: 0.612
## F-statistic: 34.91 on 2 and 41 DF, p-value: 1.404e-09
The linear model explains 61.2 % of the variability in the data. As per the data, for every increase in human death in a given year , there is a decrease in canine death by 0.044.So human and canine death are inversely proportional.
In 1970, most of the police officer died due to gunfire.This is probably due to the rise in drug trade through drug cartels who had guns and arms.
Gun fire is the highest cause of death in 1971 and through the early 70’s.
Most police officer deaths were attributed to terrorist attacks in 2001. 9/11 completely changed the global focus leading to the NATO invasion of Iraq and Afghanistan
Most police officers died due to gunfire in 2007
## -------------------------------------------------------------------------
## data.table + dplyr code now lives in dtplyr.
## Please library(dtplyr)!
## -------------------------------------------------------------------------
##
## Attaching package: 'data.table'
## The following objects are masked from 'package:lubridate':
##
## hour, mday, month, quarter, wday, week, yday, year
## The following objects are masked from 'package:dplyr':
##
## between, last
## The following object is masked from 'package:purrr':
##
## transpose
## Warning: package 'viridisLite' was built under R version 3.3.2
## Selecting by n
dept_name | n |
---|---|
New York City Police Department | 64 |
Puerto Rico Police Department | 57 |
Chicago Police Department | 36 |
California Highway Patrol | 32 |
Philadelphia Police Department | 28 |
Detroit Police Department | 24 |
Los Angeles County Sheriff’s Department | 19 |
Los Angeles Police Department | 18 |
Atlanta Police Department | 17 |
Baltimore City Police Department | 17 |
Texas Department of Public Safety - Texas Highway Patrol | 17 |
During this decade, New York City Police Department lead the number of deaths. Most of the other police stations which have high deaths belong to busy cities in the USA. California is home to one of the longest highway systems in the USA. Being the world center of technology and entertainment , the state is bound to attract millions of visitors every year.
## Selecting by n
dept_name | n |
---|---|
Puerto Rico Police Department | 58 |
Chicago Police Department | 36 |
New York City Police Department | 33 |
Los Angeles Police Department | 25 |
Detroit Police Department | 21 |
Dallas Police Department | 19 |
Philadelphia Police Department | 19 |
California Highway Patrol | 16 |
Los Angeles County Sheriff’s Department | 15 |
Houston Police Department | 14 |
Phoenix Police Department | 14 |
During this decade, the number of deaths is lead by Puerto Rico Police Department. Organized crime was high in the 1980’s in Peurto Rico. New York City Police Department’s deaths went down by two positions.
## Selecting by n
dept_name | n |
---|---|
Puerto Rico Police Department | 68 |
New York City Police Department | 30 |
California Highway Patrol | 20 |
United States Department of Justice - Immigration and Naturalization Service - United States Border Patrol | 19 |
Los Angeles Police Department | 18 |
Chicago Police Department | 15 |
Philadelphia Police Department | 12 |
South Carolina Highway Patrol | 11 |
United States Department of Justice - Drug Enforcement Administration | 11 |
Arizona Department of Public Safety | 10 |
Detroit Police Department | 10 |
Harris County Sheriff’s Office | 10 |
The Puerto Rico Police Departments’ death counts is the highest in this decade, which is attributed to organized crime in the island state.
## Selecting by n
dept_name | n |
---|---|
New York City Police Department | 88 |
Port Authority of New York and New Jersey Police Department | 39 |
Puerto Rico Police Department | 30 |
California Highway Patrol | 25 |
Chicago Police Department | 18 |
United States Department of Homeland Security - Customs and Border Protection - United States Border Patrol | 18 |
Los Angeles County Sheriff’s Department | 16 |
New York State Police | 12 |
Philadelphia Police Department | 12 |
Phoenix Police Department | 12 |
New York Police Department leads again in this decade. , followed by the port authority of New York and New Jersey Police Department. The US Department of Homeland Security has come up this time.
## Selecting by n
dept_name | n |
---|---|
New York City Police Department | 59 |
Puerto Rico Police Department | 19 |
United States Department of Homeland Security - Customs and Border Protection - United States Border Patrol | 12 |
New York State Police | 9 |
United States Air Force Office of Special Investigations | 6 |
United States Department of Justice - Federal Bureau of Prisons | 6 |
California Highway Patrol | 5 |
Detroit Police Department | 5 |
Nassau County Police Department | 5 |
New Jersey State Police | 5 |
Texas Department of Criminal Justice | 5 |
United States Department of Justice - Federal Bureau of Investigation | 5 |
United States Department of Justice - United States Marshals Service | 5 |
Virginia State Police | 5 |
The departments that appear are similar to the previous plot, but with less deaths compared to the previous decade
Better insights can be derived using month - wise, day -wise plots of individual police departments. This would give us an idea of the type of crimes that plague the given city. This would also raise the need to increase police defense to save lives