This folder contains all the code and data to create the figures and tables and perform other calculations mentioned in Spamanns The US Crime Puzzle. It also contains the cleaning code and other information to assemble the data in the first place.

1. Format: All the code and data are in Stata format. Executing the code requires the user-written packages
      -- estout (ssc install estout)
      -- parmest (ssc install parmest)
      -- grc1leg (net install grc1leg.pkg)
      -- lassoShooting.ado (faculty.chicagobooth.edu/christian.hansen/research/JEPStata.zip)

2. Main Code and Clean Data
a) Main Code: master_code.do calls all the other do files for the creation of tables and figures, and for the other calculations referenced in the paper. It defines some global macros that are used in all the other do files, so they should always be invoked through master_code.do (commenting out unwanted parts as necessary). The purpose of defining the macros in one central place is to facilitate modifications of the set of regressors etc. Master_code.do creates a subfolder to store the results, and calls code that creates imputation data sets. Before running it, you need to change the second line (put in the directory path of the folder where you have extracted this zip archive).
b) Clean Data: The top-level folder contains the cleaned data that master_code.do and its associated do-files use: paneldata.dta (the main comparative data set), state_dataset.dta (US state data for figure 2 and discussion in section 6.2.3), and USprisoners.dta (for figure 4).

3. Cleaning Code and Information; Raw Data
a) Top-level code: The sub-folder data_generation contains the code that generates the aforementioned clean data sets from raw data on the web or intermediate data stored in the sub-subfolder data_generation/datasources: paneldata_mergecode.do (generates paneldata.dta) and state_dataset_generator.do (generates state_dataset.dta) (USprisoners.dta is self-explanatory, cf. its variable labels). This code uses the folder hierarchy, so that hierarchy must be preserved when unzipping the archive that the present readme file is in.
b) Data and cleaning code and information: The intermediate data in data_generation/datasources is stored together with all information necessary to create it from raw data. In particular, it contains the cleaning code and instructions for each data series (unless self-explanatory). Whenever possible, the cleaning code directly pulls the raw data from the web. Some data (especially ICVS) require special access permissions, however, and others (like WDI or IHME) require manual downloading. In these cases, the instructions explain how to obtain the raw data and how to proceed from there, and a copy of the raw data is stored in the folder unless copyright or usage agreements prohibit this. Some data are self-explanatory and only carry a brief source not in the data label.
Some folders contain minor additional hand-collected information and documentation. The paneldata_mergecode.dta also relies on some such information (in particular, religious group and political system information from sources like Wikipedia).
The cleaning code files need to be called on a stand-alone basis, and generally require that the appropriate directory is chosen before running them (as explained in the first line of the code, or in the instructions).
