Replication files for “Mortgage borrowing and the boom-bust cycle in consumption and residential investment (Zhou 2021)” This package includes four main folders that allow a researcher to replicate the results in Zhou (2021). The contents in each folder and the instructions for replicating the results are detailed below. The author used Matlab R2019a to run files ending with “.m” and Stata MP 16.0 to run files ending with “.do”. The operating system is Windows. It is recommended that the researcher uses parallel computing or high-performance computing clusters to run the Matlab files. The author used a computer that calls 71 parallel workers when running these files. The estimated run times shown below are based on this specification. I. Figure 1 This folder contains the macroeconomic data, Matlab code, and Stata code for replicating Figure 1. The researcher will first run matlab_input.do, which generates an intermediate file for plotting. Then, run matlab_plot.m to replicate Figure 1. II. Empirical_MSA This folder contains Stata code and publicly available non-proprietary datasets for replicating the empirical results in Section 3. (i) To replicate the results in Table 1 (effects of house price shocks), 1. Run Data_permit_clean.do to generate MSA-level building permit data for panel regression. 2. Run Data_retail_clean.do to generate MSA-level retail per capita data for panel regression. 3. Run Data_hpi_clean.do to generate MSA-level house price growth data for panel regression. 4. Run Table1_HP_shock.do to replicate the regression results in Table 1 and Table A1 Panel I. (ii) To replicate the results in Table 2 (effects of mortgage rate shocks), 1. Run Data_mcdash_clean.do to generate MSA-level rate gap data for panel regression. 2. Run Data_permit_clean.do to generate MSA-level building permit data for panel regression. 3. Run Data_retail_clean.do to generate MSA-level retail per capita data for panel regression. 4. Run Data_hpi_clean.do to generate MSA-level house price growth data for panel regression. 5. Run Table2_Rate_shock.do to replicate the regression results in Table 2 and Table A1 Panel II. (Notes on sharing McDash data: Replicating the results in Table 2 requires the access to Black Knight McDash Mortgage Servicing data, which consist of confidential and proprietary information that is the exclusive property of McDash Analytics. The author accessed the data through the Federal Reserve System RADAR data warehouse. Federal Reserve System employees, visiting scholars and contractors may request the access to the data. Researchers outside the Federal Reserve System may also establish an agreement with McDash Analytics to obtain the access. The replication package provides Stata code and other non-proprietary data as well as detailed instructions that allow a researcher who has access to the data to fully replicate the results in Table 2.) (iii) To replicate the results in Table 3 (effects of credit supply shocks), 1. Run Data_permit_clean.do to generate MSA-level building permit data for panel regression. 2. Run Data_retail_clean.do to generate MSA-level retail per capita data for panel regression. 3. Run Data_hpi_clean.do to generate MSA-level house price growth data for panel regression. 4. Run Do_Credit_shock_Table3.do for regression results in Table 3 and Table A1 Panel III. III. Empirical_PSID This folder contains publicly available PSID main family data 1999-2015, the Stata code and macroeconomic data on annual cpi and quarterly mortgage rates for replicating the empirical results in Section 6. To replicate the results in Tables 6, 7, 8, 9, B1, B2, B3 and B4, 1. Run Data_psid_clean.do to generate an intermediate household-level panel data file. 2. Run “Table##.do” for replicating the results in the corresponding table. IV. Model This folder contains Matlab and Stata codes for replicating the numerical results from the theoretical model of the paper. (i) Steady state results (Figures 2 and 3; Tables 6, 7, 8 and 9) To replicate Figures 2 and 3, 1. Run run_ss.m to generate simulated household-level choices in the steady state. (Estimated run time: 30 minutes) 2. Run Figure2.m and Figure3.m to reproduce the results in the corresponding figure. To replicate Tables 6, 7, 8 and 9 1. Run run_ss.m to generate simulated household-level choices in the steady state. (Estimated run time: 30 minutes) 2. Run run_modeldata.m to generate an intermediate file that contains key variables for household-level regressions. 3. Open subfolder “StataDofiles” and run Do_modeldata.do to create additional variables for household-level regressions. 4. Run “Table##.do” in the subfolder to replicate the Stata regression results in the corresponding table. (ii) Responses to permanent shocks (Figures 4, 5 and 6) To replicate Figures 4-6, 1. Run run_shock.m and specify the shock (among house price shocks, mortgage rate shocks and credit supply shocks). This will generate an intermediate file containing household choices before and after the shock. (Estimated run time: 30 minutes for each shock) 2. Run file Figure#.m to generate the results in the corresponding figure. (iii) Business-cycle fluctuations (Figures 7, 8, 9 and H1) To replicate Figures 7-9 and H1, 1. Run run_cycle.m to generate an intermediate file of household choices over the cycle. (Estimated run time: 5 hours) 2. Run file Figure#.m to generate the results in the corresponding figure. (iv) Appendix D: Canonical model with one investment type (Figures D1 and D2) The replication files are in subfolder “onetypeinv”. To replicate FiguresD1, first run run_ss.m to generate an intermediate file of simulated household choices. Then, run file figureD1.m. To replicate FiguresD2, first run run_shock.m and specify the shock (among house price shocks, mortgage rate shocks and credit supply shocks) to generate an intermediate file of simulated household choices before and after the shock. Then, run file figureD2.m. (Estimated run time: 30 minutes each file) (v) Appendix E: Impulse response functions (Figures E1, E2 and E2) To replicate the impulse responses from the life-cycle model, first run run_shock_irf.m to generate the intermediate file of impulse responses and then run FigureE1_E2_E3.m. The impulse responses from the IN model can be obtained from the replication package of Iacoviello and Neri (2010 AEJ: Macro). (Estimated run time: 5 hours) (vi) Appendix F: Accounting for simultaneous responses of house prices to the mortgage rate or to the credit shocks (Figures F1 and F2) To replicate Figure F1, first run run_shock_r_hp.m to obtain the intermediate results and then run Figure F1.m. To replicate Figure F2, first run run_shock_credit_hp.m to obtain the intermediate results and then run Figure F2.m. (Estimated run time: 30 minutes for each shock combination) (vii) Appendix G: Accounting for house price expectations (Figure G1) To replicate Figure G1, first run run_shock_exp to obtain the intermediate file with a specific value of expectation parameter (i.e, lambda=0.1, 0.2, 0.3). Then, run Figure G1. (Estimated run time: 4 hours for each lambda value)