Project: Distance Between Schools and Gun Retailers and Odds of School Gun Incidents in the United States
Authors: Falco Bargagli Stoffi, Michelle Qin
Contributors: Michelle Audirac, Nishtha Sardana
Created: June 2022
Overview: Causal inference to estimate causal and associative effects of average firearm-dealer-to-school proximity on occurrence of a school gun incident within a school-containing census tract in the United States.
Request data_input_private.zip
from the authors. Unzip in the data/input/private/ folder.
Generate the dataset used for analysis and Table 1 by running:
cd code
Rscript --vanilla make_datasets.R
Rscript --vanilla make_table1.R
Install the CausalGPS R package (use version 0.4.0 or higher).
Decide whether to run the GPS matching model that uses Generalized Estimating Equations (GEE) for the outcome model.
run_gee_model = F
or run_gee_model = T
in causal_analyses.R
accordingly.Perform all main analyses by running:
bash associational_analyses.sh
bash causal_analyses.sh
Consolidate and visualize the results by running:
Rscript --vanilla read_and_plot_covariate_balance.R
Rscript --vanilla read_all_model_results.R
Rscript --vanilla plot_main_results_as_odds_ratio.R
Perform additional sensitivity analyses by running (i) commented lines in associational_analyses.sh
and causal_analyses.sh
and (ii) code in the supplementary/
folder.
supplementary/
, you will again need to decide whether to run GEE models (for GPS matching models and for the state-level spatial confounding robustness check, denoted gee_associational_model
).logs/
folder within supplementary/
to save the output.Michelle Qin (mqin8 [at] jh.edu), Falco Bargagli Stoffi (fbargaglistoffi [at] hsph.harvard.edu)