Coder Social home page Coder Social logo

fboehm / gun-sales Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nytimes/gunsales

0.0 1.0 0.0 493 KB

Statistical analysis of monthly background checks of gun purchases

Home Page: http://www.nytimes.com/interactive/2015/12/10/us/gun-sales-terrorism-obama-restrictions.html

License: Other

R 100.00%

gun-sales's Introduction

Analysis of NCIS gun purchase background checks

Statistical analysis of monthly background checks of gun purchases for the New York Times story What Drives Gun Sales: Terrorism, Obama and Calls for Restrictions.

Pre-requisites

This script uses the R package seasonal for the seasonal adjustments, which itself uses a program called X-13ARIMA-SEATS. Binaries for this program are available for Windows only, but there is a very helpful compilation guide for Mac OS X. If that doesn't work, try downloading the program from here.

Running the script

You can either open main.R in RStudio and run it line by line or run the entire script as a whole on the command-line:

$ R --no-save < main.R

The script creates the PDF plots and CSV files in the out/ folder.

For more explanation of what the script is doing, please read through the comments in main.R.

Data issues

The source data comes from the FBI's National Instant Criminal Background Check System, and was converted from the original PDF format to CSV using Tabula.

BuzzFeed also released the same dataset on Github last week.

Getting gun sales estimates from background checks

To convert background checks into estimated sales, we relied on a method suggested in the Small Arms Survey by Jurgen Brauer, a professor at Georgia Regents University. Each long gun and handgun check was counted as 1.1 sales. Each multiple-gun check was counted as two sales. Permit checks and other types of checks were omitted. The multiplier is an estimate based on Mr. Brauer's interviews with gun shop owners.

Note: In our computation, we excluded background checks for the "multiple" category in California because they followed an unusual pattern that did not match California gun sales data.

gun-sales's People

Contributors

gka avatar joshkeller avatar

Watchers

Frederick Boehm avatar

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.