library(readxl)
ccrb = read_excel( "ccrbcomplaints.xlsx")
ggplot(ccrb,aes(x=ReceivedYr))+
geom_bar(stat="count", fill="light blue", col = "light blue")+
labs(title="Trends in Complaints from 2006-2016", x="Year in which complaint was received",y="Number of Complaints")+
theme_bw()
As we have started reviewing incidences that were closed from 2006 onwards, 2004 and 2005 incidences that were recorded before 2016 onward, and hence will need to be excluded from our analysis.
ggplot(ccrb,aes(x=IncidentYr, fill=AllegationFADOType)) + geom_histogram(stat = "count") + labs (title = "Complaints by Allegation Type over the years", x="Year", y="Complaints") + theme (legend.position = "bottom") + scale_fill_discrete(name = "Allegation Type") +scale_x_continuous(breaks = seq(1999,2016,2))
The complaints have decreased over the years from 2006 - 2016, with a decline in every type of allegation. Abuse of authority and Force form the largest portion of allegations, and each have declined to 1/3rd of the 2006 status.
ggplot(ccrb, aes(x=ReceivedYr, colour = BoroughofOccurrence)) + geom_freqpoly(binwidth =2) + labs(title="Trends in complaints received by NYC Boroughs", x = "Year in which complaint was received") + xlim (2004, 2016) +
theme_bw()
All boroughs have seen a decline in complaints, however, as observed earlier, Brooklyn, which had the highest number of complaints in 2006, has seen a stark decline in complaints.
ggplot(ccrb,aes(x=BoroughofOccurrence, fill=AllegationFADOType)) + geom_histogram(stat = "count") + labs (title = "Complaints by Allegation Type and NYC Boroughs", x="Borough", y="Complaints") + theme (legend.position = "bottom") + scale_fill_discrete(name = "Allegation Type")
Maximum number of complaints were from Brooklyn, followed by Bronx and Manhattan respectively. The lowest number of compliants were from Staten Island, which is probably because of lesser resident population in the borough.
ccrb$TimetoClose = ccrb$CloseYr-ccrb$IncidentYr
ggplot(ccrb, aes(x=BoroughofOccurrence, y = TimetoClose, fill = BoroughofOccurrence)) + geom_bar(stat="identity", position = "dodge" ) + labs (title = "Average time taken to close complaints by Boroughs", x="Borough", y="Avg time taken to close complaint") + stat_summary (aes(fun.y = 'mean')) + ylim(0, 1)
On an average, all the complaits are addressed within a year. The average time taken to close complaints is approximately the same in areas with higher volumes of complaints.
ggplot(ccrb, aes(x =AllegationFADOType)) + geom_bar (aes(fill = as.factor(IsFullInvestigation)), stat = "count", position = 'stack')
A little less than 50% of the allegations were fully investigated. The distribution is similar across all allegation types.
ggplot(ccrb, aes(x =IncidentLocation)) + geom_histogram(stat = "count") + coord_flip()
Majority of the incidences for which complaints were made took place on a highway or a street.
ggplot(ccrb, aes(x = AllegationFADOType, fill = EncounterOutcome)) +
geom_histogram(position = 'dodge', stat = 'count')
Proportionally, for allegations of abuse of authority, there were more instances where arrests or summons were not made. For force, on the other hand, there were a higher number of arrests or summons.
ggplot(ccrb, aes(x = BoroughofOccurrence, fill = EncounterOutcome)) +
geom_histogram(position = 'dodge', stat = 'count')
In Brooklyn and Bronx, the areas with the higest volume of complaints, more arrests were made than the cases where no action was taken. In Manhattan, proportionally there were more instances where arrests or summons were not made.
There has been a significant decline in complaints across all boroughs and for all allegation types. This could either be because of mitigative action taken by the departments or because people have identified other modes of compalining or showing their displeasure. Majority of the complaints are made for abuse of authority and force. The NYC authorities might find it pertinent to identify causes for these complaints, and design avenues for improving public image. Brooklyn and Bronx have seen a significant decline proportionate to the other boroughs, but continue to see the highest volumes of complaints. Majority of the incidences are observed on the street/ highways or from apartments, but very little video evidence is available.
2. Comolaints by allegation type: