Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.


Build Status


This case study is part of the OpenCaseStudies project. This work is licensed under the Creative Commons Attribution-NonCommercial 3.0 (CC BY-NC 3.0) United States License.


To cite this case study:

Stephens, Alexandra and Jager, Leah and Taub, Margaret and Hicks, Stephanie. (2019, February 14). opencasestudies/ocs-police-shootings-firearm-legislation: Firearm Legislation and Fatal Police Shootings in the United States (Version v1.0.0). Zenodo.



Firearm Legislation and Fatal Police Shootings in the United States (A recreation of the study found at

Motivating question

Is stricter firearm legislation associated with rates of fatal police shootings?


All data is grouped at the state level. The following are the main variable for the analysis:

  • The Brady Center state-level firearm legislation “scorecard” for 2015.
  • The Counted is a project by The Guardian dedicated to counting the number of people in the United Stated killed by police or other law enforcement in 2015 and 2016.

The following data is collected to control for potential covariates (at the state level) including median age, population density, violent crime rate, gun ownership, percent male, percent white, percent black, percent hispanic, unemployment rate, and education.


The bulk of the analysis is collecting, cleaning, manipulating and merging data.

  • dplyr is used to filter and group data and calculate relevant statistics by state (group_by, tally, filter, summarize, select)
  • rvest is used to create a web scraper & retrieve the unemployment data from the BLS.

The statistical analysis involves Poisson regression and statistical significance tests, which will be completed shortly.

Other notes and resources

Again, we make no claims to the results or findings of this study, as we are recreating the American Journal of Public Health study, “Firearm Legislation and Fatal Police Shootings in the United States” found at


OCS: Examine the relationship between fatal police shootings and firearm legislation



No packages published