UBC-MDS / CPD

Analysis of complaints received by the Chigaco Police Department from the years 2005-2015.
MIT License
0 stars 7 forks source link

Chicago Police Dataset (CPD) - Complaints Analysis

Analysis of complaints received by the Chicago Police Department from the years 2005-2015. Investigation of the relationship between salary and number of complaints received.

About

Here we attempted to determine if there is a relationship between salary and number of complaints received by Police Officers working for the Chicago Police Department for the years 2005-2015, using linear regression models. We first used a simple linear regression model, this model indicates there is a negative linear relationship between salary and number of complaints received. We then expanded our scope to multivariable regression models, including potentially confounding demographic variables such as age, race and gender. There was a small but significant positive association between salary and number of complaints when holding the effects of all demographic variables constant.

Datasets and documents used in this project are sourced from the Chicago Police Department (CPD), Civilian Office of Police Accountability (COPA), the Independent Police Review Authority (IPRA), or the City of Chicago. However, we are building off of data that has been cleaned and matched from a repository maintained by the Invisible Institute.

Report

The final report can be found here

Usage

There are two suggested ways to replicate our analysis:

1. Using Docker

note - the instructions in this section also depends on running this in a unix shell (e.g. terminal or Git Bash)

First install Docker. Then clone this GitHub repository and run the following command at the command line/terminal from the root directory of this project:

On a Windows machine:

docker run --rm -v "PATH-ON-YOUR-COMPUTER":/home/rstudio/CPD elanor333/cpd:v0.5.0 make --directory=home/rstudio/CPD all

On a non-Windows machine:

docker run --rm -v /$(pwd):/home/rstudio/CPD elanor333/cpd:v0.5.0 make -C home/rstudio/CPD all

To reset the repo to a clean state, with no intermediate or results files, run the following command at the command line/terminal from the root directory of this project:

On a Windows machine:

docker run --rm -v "PATH-ON-YOUR-COMPUTER":/home/rstudio/CPD elanor333/cpd:v0.5.0 make --directory=home/rstudio/CPD clean

On a non-Windows machine:

docker run --rm -v /$(pwd):/home/rstudio/CPD elanor333/cpd:v0.5.0 make -C home/rstudio/CPD clean

2. Without using Docker

To replicate the analysis, clone this GitHub repository, install the dependencies listed below, then run the following commands at the command line/terminal from the root project directory:

make all

To reset the repo to a clean state, with no intermediate or results files, run the following command at the command line/terminal from the root directory of this project:

make clean

Makefile Dependency Diagram

makefile_diagram

Dependencies

References

Irizarry, R. (2020, November 16). Introduction to Data Science. Retrieved November 28, 2020, from https://rafalab.github.io/dsbook/regression.html

Invisible Institute. (2017). Invinst/chicago-police-data. Retrieved November 28, 2020, from https://github.com/invinst/chicago-police-data