GithubHelp home page GithubHelp logo

eboylestanley / cpd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ubc-mds/cpd

0.0 0.0 1.0 24.86 MB

License: MIT License

Python 0.28% Jupyter Notebook 94.26% R 4.44% Makefile 0.74% Dockerfile 0.28%

cpd's Introduction

Chicago Police Dataset (CPD) - Complaints Analysis

  • authors: Ela Bandari, Elanor Boyle-Stanley, Micah Kwok

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 scope to multivariate regression models, including potentially confounding demographic variables such as age, race and gender. Given that the demographic variables had statistically significant coefficients, they were identified as potentially confounding variables and taken into consideration in modeling the relationship between number of complaints and salary.

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

Dependencies

  • Python 3.8.3 and Python packages:

    • docopt==0.6.2
    • pandas==1.1.1
    • requests==2.23.0
  • R version 4.0.2 and R packages:

    • docopt==0.7.1
    • tidyverse==1.3.0
    • janitor==2.0.1
    • lubridate==1.7.9
    • GGally==2.0.0
    • broom==0.7.0
    • testthat==3.0.0.9000

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

cpd's People

Contributors

eboylestanley avatar micahkwok avatar elabandari avatar

Forkers

elgohr-update

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.