Replication code for "Using Macro Counterfactuals to Assess Plausibility: An Illustration using the 2001 Rebate MPCs" by Jacob Orchard, Valerie Ramey, and Johannes Wieland
Tested on MAC and Linux using STATA version 18.5 and Python 3.13.
The project is set up to work in a MAC or LINUX enivironment (UNIX more generally). We provide instructions for Windows in the Github repository for the paper Micro MPCs and Macro Counterfactuals: The Case of the 2008 Rebates.
You can use our code with proper attribution.
Please cite as:
Orchard, Jacob, Valerie A. Ramey, and Johannes F. Wieland. Using Macro Counterfactuals to Assess Plausibility: An Illustration using the 2001 Rebate MPCs. Economic Journal, Forthcoming.
The authors of the manuscript have legitimate access to and permission to use the data used in this manuscript. The authors of the manuscript have documented permission to redistribute/publish the data contained within this replication package.
You will need your own FREDKEY and BEA keys to download the source data. Place the FREDKEY in line 34 of MPC/forecasting/code/build_forecast_data.do and place the BEA key in line 14 of MPC/downloaddata/code/pcefromBEA.py and line 16 of MPC/downloaddata/code/pull_pce_detail.py.
We use make to run the entire project. cd into the base directory and run the following commands in your terminal:
-
make install -
make venv -
make
The first command builds the Python virtual environment, the second command executes the project.
Once make executes successfully, the paper figures and tables are available in the folder _finaltablesandfigures/output.
Around 2 hours.
For a list of required python packages see requirements.txt (running `make install' should automatically install the required packages). In addition to the packages in requirements.txt, some users have had to install fastparquet directly.
STATA packages:
ssc install did_imputation
ssc install ranktest
ssc install ivreghdfe
For ivreghdfe, it may be useful to install the latest version from github to avoid a ``last estimates not found'' error (see this help article here). We are grateful to the data editor for pointint out this issue.
This project is divided into a series of subfolders that execute all of the tasks leading to final output beginning with downloaddata and ending with _finaltablesandfigures. Each subfolder contains both a code directory and, once-executed, input and output directories. The makefile in the code folder documents how the inputs are converted in the outputs for the task. The input directory will have symbolic links to output from previous tasks, while the output directroy will include all of the output used by subsequent tasks. The final output for the paper is mostly created in the forecasting, psmjregressions, model, and narrative subfolders.
The makefile in the main folder shows the order of execution of the subfolders. The graph below shows the relationship between tasks.
- downloaddata: Downloads CEX data from the BLS and saves as zip files. Also downloads PCE data from the BEA.
- appendCEXfiles: Unzips the downloaded CEX data, appends household info (fmli), expenditure (mtbi) and tax rebate (TAX) files together.
- ucccodemappings: Creates code mappings from CEX ucc codes to larger JPS or PCE consumption aggregates
- createconsumptionvariables: Uses the CEX data and the ucccodemappoings to create consumption variables for each houshold
- testingconsumptionaggregation: Tests that aggregated consumption from the MTBI files is equal to household consumption in the FMLI files
- processrebatemodule: Creates rebate amount variable and indicator for each household
- createfamilycharacteristics: Creates other household level variables
- nipavariables: Merges relevant PCE household level variables with household characteristics
- psmjvariables: Merges consumption based on JPS definition with household characteristcs
- psmjsample: Creates final sample of households following JPS paper
- psmjregressions: Empirical regressions and tables (Tables 4, 5, 6, and appendix Table B.1)
- jpsexpenditure: Uses the JPS definition of consumption to create a time series of aggregate nondurable expenditure.
- survey_prof_fore: Downloads and cleans data from the Survey of Professional Forecasters (Figure 5)
- forecasting: Creates our own forecasts from section 5 of the paper (Figure 5)
- narrative: Creats narrative figures (Figures 1, 2 and 3)
- model: Solves model and produces Tables 1, 2, 3, Figure 4, and appendix Figure C.1.
- symlink_graph: Creates chart showing input-output dependencies above
- _finaltablesandfigures: Tables and figures used in the paper will be copied here.
The following table lists which figure is generated by which final task. One can generate one figure at a time by going into the corresponding task/code directory and running make.
| Figure/Table | Figure/Table Filename | Task Directory |
|---|---|---|
| Figure 1 | fig_cy_pres.eps | narrative |
| Figure 2 | fig_rebate_ndisp01.eps | narrative |
| Figure 3a | fig_cy_pres01.eps | narrative |
| Figure 3b | fig_jpscy_pres01.eps | narrative |
| Figure 4a | Real_JPSNondurablesfc_micro_nondurablesonly2001.eps | model |
| Figure 4b | Real_JPSNondurablesfc_GE_nondurablesonly2001_nolegend.eps | model |
| Table 1 | calibrationnondurablesonly2001gamma.tex | model |
| Table 2 | mpcsgammanondurablesonly2001.tex | model |
| Table 3 | Real_JPSNondurables_911_GE_nondurablesonly2001.tex | model |
| Figure 5a | SPF_dist_0102_wactual.pdf | survey_prof_fore |
| Figure 5b | fig_forecasts2001_jpsnondur.eps | forecasting |
| Table 4A | Table_2001_NDcompare.tex | psmjregressions |
| Table 4B | Table_2001_NDcomparerbtonly.tex | psmjregressions |
| Table 5 | bea_all.tex | psmjregressions |
| Table 6A | Table_2001_NDcompare_wlag.tex | psmjregressions |
| Table 6B | Table_2001_NDcompare_wlagrbtonly.tex | psmjregressions |
| Appendix Table B.1 | coefsall_prettytable.xlsx | psmjregressions |
| Appendix Figure C.1 | Real_JPSNondurablesfc_micro_nondurablesonly2001_appendix.eps | model |
For data that may be revised in the future, such as aggregate data downloaded from FRED, we include a plain text version of the data in the subfolder report.
This project code downloads data from the Bureau of Labor Statistics (BLS), the Federal Reserve Bank of Philadelphia (the SPF surveys), and the Bureau of Economic Analysis (BEA). The user of these replication files will be under the license requirments of these files when they run the replication code.
Bureau of Economic Analysis (2000-2002). ‘National income and product accounts’, US Department of Commerce
Bureau of Labor Statistics (2000-2002). ‘Consumer expenditure survey’, US Department of Labor.
Federal Reserve Bank of Philadelphia (2001). ‘Second quarter 2001 survey of professional forecasters’, Survey of Professional Forecasters.
All datasets that are not downloaded directly by the code are included in the folder external_data. There are also .csv versions of all of the below data files.
| Name | Source | Citation | License |
|---|---|---|---|
| rebates.xlsx | Authors and Shapiro and Slemrod Table 6 and Sahm, Shapiro and Slemrod | Shapiro, and Slemrod (2003), Sahm, Shapiro, Slemord (2012) | Creative Commons and GNU General Public License v3.0* |
| JPS_consumption_rebate.xlsx | Authors and BEA | Orchard, Ramey, Wieland (Forthcoming) and BEA (2000-2002) | Public domain and GNU General Public License v3.0 |
| ce-pumd-interview-diary-dictionary.xlsx | BLS | BLS (2024) | Public domain |
| BEA_labels.xls | Authors | Orchard, Ramey, Wieland (Forthcoming) | GNU General Public License v3.0 |
*Authors use "GNU General Public License v3.0" while Sahm, Shapiro, and Slemord (2012) use the Creative Commons license. The creative commons license is copied in this replication folder under license_sss.
Bureau of Economic Analysis (2000-2002). ‘National income and product accounts’, US Department of Commerce
Bureau of Labor Statistics (2000-2002). ‘Consumer expenditure survey’, US Department of Labor.
Orchard, Jacob, Valerie A. Ramey, and Johannes F. Wieland. Using Macro Counterfactuals to Assess Plausibility: An Illustration using the 2001 Rebate MPCs. Economic Journal, Forthcoming.
Sahm, Claudia R, Matthew D Shapiro, and Joel Slemrod, 2012. “Check in the mail or more in the paycheck: does the effectiveness of fiscal stimulus depend on how it is delivered?” American Economic Journal: Economic Policy 4(3): 216–50.
Shapiro, Matthew D and Joel Slemrod, 2003b. “Did the 2001 tax rebate stimulate spending? Evidence from taxpayer surveys.” Tax policy and the economy 17: 83–109.
