Published December 4, 2017 | Version v1
Software Open

Supporting code for "Optimal tradeoffs in matched designs for observational study"

Authors/Creators

  • 1. University of California, Berkeley

Description

This code implements the data assembly and data analysis for the working paper, "Optimal tradeoffs in matched designs for observational studies," by Samuel D. Pimentel (UC Berkeley) and Rachel R. Kelz (University of Pennsylvania).  Information on obtaining a copy of the draft is available at https://www.stat.berkeley.edu/~spi/.  The code consists of two parts, data assembly (conducted in SAS and Stata) and data analysis (conducted in R). 

Data Assembly. The data assembly is done by five scripts.  The first 2 SAS scripts, PullGenSurgFL.sas and PullGenSurgNY.sas, extract the general surgery hospital discharge claims from raw data files provided by Florida and New York respectively.  The next 2 Stata scripts, CleanGSFL.do and CleanGSNY.do, clean this raw data into a more usable format.  Finally, the Stata script PullUSMGvsIMGData.do, combines the cleaned claims data from both states and cleans and links in surgeon covariates from the AMA masterfile.  The final output is a single Stata file called TwoStateIMGUSMG.dta, which is used as the input to the data analysis.

 Data Analysis. The data analysis is run using a single master R script, main_script_v2.R. This script is accompanied by five additional R files which define various types of helper functions used in the analysis (and are loaded as part of the main script): descr_stats.R, attributable_effects_v3.R, obj_to_match.R, my_dummy.R, and tradeoff_functions_v5.R.  As input, the master script relies on the TwoStateIMGUSMG.dta file created in the data assembly stage. It also uses two auxiliary files, NYfips.csv and FLfips.csv, which each contain two columns, the first giving FIPS codes and the second county names, for the appropriate states.

Files

optimal_tradeoffs_code.zip

Files (43.3 kB)

Name Size Download all
md5:5573e210b601185c1743c41cb2fd2547
43.3 kB Preview Download