DOI: 10.7910/dvn/8rcmzp
title: Replication Data for 'Big G'

description: The files described below replicate the results of "Big G". They are divided into three parts, which can be found in three different sub-folders: (1) FiveFacts, (2) ModelSimulation, and (3) VAR. 


*************************************************************************************
******************* PART 1: Five Facts on Government spending ***********************
*************************************************************************************

Folder: FiveFacts

This folder contains code to replicate Figures 1-4 and Tables 1-4 in Section 3 of the paper. 
____________

Data Set-Up 
____________

In order to run the included script files, the main dataset needs to be assembled. The data on federal procurement contracts used in this paper is all publicly available from USASpending.gov. The base dataset used for all of the empirical results in this paper consists of the universe of procurement contract transactions from 2001-2019---around 30 GB of data. Due to its size, the data requires a substantial amount of computing power to work with. 

Our approach was to load the data into a SQL database on a server, following the instructions provided by USASpending.gov, which can be found here: https://files.usaspending.gov/database_download/usaspending-db-setup.pdf. As a result, the replication code cannot feasibly start with the raw dataset, though we have provided the raw files at an annual basis at [INSERT URL FOR SITE HERE]. 

The files "setup_data_1.R", "setup_data_2.R", "setup_data_3.R", and "setup_data_4.R" pull from the SQL database and create intermediate files that are provided with this replication package. You will NOT be able to run the "set_up" files without setting up your own SQL database, but you CAN run the Figure and Table replication code (described below) using the intermediate files created in the setup files. 

_______________

 Figures 
_______________

Figure 1
 + Step 1: Run 'create_contract_proxy.R,' which creates a dataset called 'contracts_for_ramey_merge.dta'
 + Step 2: Run ramey_zubairy_replication.do, which is a file TAKEN DIRECTLY FROM THE REPLICATION PACKAGE 
 for Ramey & Zubairy (JPE, 2018), found at the link below. We merge our dataset into theirs, and 
 re-run their regressions on our data. 
 Ramey & Zubairy (2018) replication: https://econweb.ucsd.edu/~vramey/research/Ramey_Zubairy_replication_codes.zip. 

Figure 2
+ 'Figure_2a.R' produces Figure 2a using 'intermediate_file_1.RData'
+ 'Figure_2b.R' produces Figure 2b using 'intermediate_file_2.RData'

Figure 3
+ 'Figure_3a.R' produces Figure 3a using 'intermediate_file_3.RData' 
+ 'Figure_3b.R' produces Figure 3b using 'intermediate_file_2.RData' 
 

Figure 4
+ 'Figure_4.R' produces Figures 4a and 4b using 'intermediate_file_3.RData' 

_______________

 Tables 
_______________


Table 1
+ 'Table_1.do' produces Table 1 using 'contracts_for_ramey_merge.dta' 

Table 2
+ 'Table_2_upper' produces the top portion of Table 2 using the 'sectors_unbalanced.dta' file created in 'setup_data_4.R' 
+ 'Table_2_lower' produces the lower portion of Table 2 using the 'firms_unbalanced.dta' file created in 'setup_data_4.R' 

Table 3
+ 'Table_3.R' produces Table 3 using 'intermediate_file_1.RData'. 

Table 4
+ Components for Table 4 can be found in 'Figure_3a.R' and 'Figure_3b.R' (noted in those files). 
 

*************************************************************************************
************************** PART 2: Model Simulation *********************************
*************************************************************************************

Folder: "ModelSimulation"

 + Matlab file MAIN_generateIRFs.m generates Figures 5 and 6 in the paper. It calls the mod file modelG.mod

 + Matlab file MAIN_generateIRFs_htm.m generates Figure A.21 in the Appendix. It calls the mod file modelG_htm.mod

 + Both files run on Dynare 5.4. 



*************************************************************************************
******************************** PART 3: VAR ****************************************
*************************************************************************************

Folder: "VAR" (see README in VAR folder for more detail). 

Data Setup: "setup_var_data.R," like the files in the FiveFacts folder, will not run. They create a dataset of contracts by month and naics2 sector from the SQL database. 

+ 'VAR.do' runs the VAR that produces Figure 7.