readme.txt Steven Laufer, July 2017 This file describes the attached data and computer code used in generating the results of "Equity Extraction and Mortgage Default," by Steven Laufer, published in the Review of Econoomic Dynamics. Data The original data was provided by First American Core Logic in a set of csv files with filenames of the form liens`yr'q`qq'.csv. These files are prorpietary but may be available from what is now CoreLogic. Assuming you now have these csv files, run the following do-files in STATA. These will call all of the other do-files, each of which is explained in the comments withing those files. 1. doall.do (creates STATA files from the csv files) 2. structural.do (creates all the txt files to be read in by FORTRAN code) 3. rename3y.do (renames the txt files) Running these files will create the following txt files that are inputs into the FORTRAN code. These files are included in the attached documents. dhpidata_all3y.txt dhpidata3y.txt refdefdatasim3y.txt smoothunemp3y.txt dataoutcomes3y.txt The results from multinomial-logit estimation described in section 4.4 can be reproduced by running the following two do-files. 1. makedata2.do (constructs the data sample) 2. mlogit04112.do (generates summary statistics and runs estimation) Finally, the results of the structural model can all be generated by compiling the file program.f90 and running the resulting exacutable. The program is written in FORTRAN 90/95 and can be compiled using any standard FORTRAN comiler. The program is written using MPI but can be run on a single processor. In addtion to the data files listed above, the program uses the following three txt input files 1. parAug16.txt (contains the estimated parameters) 2,3. MSpars.txt and hpisimprobs.txt (contain the estimated parameters for house price expectations and the expected house price growth for each observation, created by running the program with the call to estimate_hpiMS on line 7323 un-commented) 4. basestartvalues.txt (the starting conditions for the counterfactuals, created as simstartvalsRED.txt by running the program as written with write_sims=.TRUE. in line 4047) 0. As written, the program solves the model, outputs moments to momentsRED.txt. Whether or not outher outputs are written to files is controlled by the options in lines 4047-4049. The program should run in 5-10 minutes. 1. To estimate the model, set ind_opt=.TRUE. (line 4040) To run counterfactuals, change the finename label in line 4039 and make the following adjustments to the file to generate the different results: 2. To run a counterfactual with limits on the maximum LTV allowed in a refinance: a. Decide whether you want to allow a response in housing prices by setting initial_cond=3 or 4 (line 4042) b. Set the index of the maximum allowed LTV (maxmcf in line 4044) Each of thhe counter-factial exercises where one of the shocks is turned off is indicated by the word "COUNTERFACTUAL" in the program 3. To turn of variation in expected house price growth, un-comment the command phighit=.5 in line 6093. 4. To turn off variation in expected house price growth only after 2006q3, also un-comment the IF-THEN statement in lines 6092 and 6094. 5. To turn off the moving shock after 2006q3, un-comment the command exitshocks(1)=.99 and the surrounding IF-THEN statemment (lines 6100-6102) 6. To turn off the unemployment shock, un-comment the command esim(tt+1,ii)=Ne (line 6223). 7. To turn off the unemployment shock only after 2006q3, also un-comment the surrounding IF-THEN statement (lines 6222,6224). 8. To turn off house price growth, un-comment the command hprime=hsim(tt,ii) (line 6248). 9. To turn off house price growth only after 2006q3, also un-comment the surrounding IF-THEN statement (lines 6247,6249). 10. To allow for a non-zero limit on unsecured borrowing, change borrowlim (line 4189) To compute standard errors, un-comment out the call to refdef_stderr on line 7434. The following programs (written in MATLAB) analyze the results: 1. allplots.m (creates graphs based on the policies and simulations. Calls the program loadpols.m) 2. welfare.m (performs welfare calculations) 3. compareEE.m (compares equity extraction and default outcomes in baseline and conter-factuals)