Statistical Analysis of Monthly Background Checks of Gun Purchases

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" at < http://www.nytimes.com/interactive/2015/12/10/us/gun-sales-terrorism-obama-restrictions.html?> is provided.


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.

This package depends on the R package seasonal for the seasonal adjustments, which itself uses a program called X-13ARIMA-SEATS. Windows, OS X and Linux binaries for this program are installed by the R package x13binary.

Both packages are now on CRAN and can be installed along with the other dependencies via

Once the package has loaded, run this in an R shell:

> library(gunsales)
> df <- analysis()

to create a single dataframe containing the results. The dataframe can be visualized via

> plot_gunsales(df)    
> ggplot_gunsales(df)

to create, respectively, plots via R base or ggplot2. Options to save the output in the out/ folder exist. The resulting ggplot2 charts are shown below:

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.

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.

News

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("gunsales")

0.1.2 by Dirk Eddelbuettel, 4 months ago


Browse source code at https://github.com/cran/gunsales


Authors: Gregor Aisch, Josh Keller and Dirk Eddelbuettel


Documentation:   PDF Manual  


Apache License (== 2) license


Imports utils, dplyr, seasonal, ggplot2, data.table, zoo, x13binary

Suggests knitr, rmarkdown


See at CRAN