version 16

*Adjust these global macros to the correct paths
global rawdata_path 			"U:\SOEP\STATA_DEEN_v34\soep.v34\stata_de+en\"
global do_path					"U:\Projekt Thyssen\IntergenTimeTrans\Replication EER\do\"
global output_path  			"U:\Projekt Thyssen\IntergenTimeTrans\Replication EER\"
global replication_ado_path 	"U:\Projekt Thyssen\IntergenTimeTrans\Replication EER\ado\plus/"

cap mkdir "${output_path}\tmp\"
cap mkdir "${output_path}\Results\"

adopath + "${replication_ado_path}"

do "${do_path}\01_birth_histories.do"
do "${do_path}\02_Create_data.do"
do "${do_path}\03_Figure1.do"
do "${do_path}\04_Figure2.do"
do "${do_path}\05_Figure3.do"
*Figure 4 is created using three scripts, Estimation1 and Estimation2 estimate the main effects (panels A and D) and cross effects (panels B and C), while Plot then creates the figure from these estimations.
do "${do_path}\06_Figure4_Estimation1.do"
do "${do_path}\07_Figure4_Estimation2.do"
do "${do_path}\08_Figure4_Plot.do"

do "${do_path}\09_Figure5.do"
do "${do_path}\10_Figure6.do"
*Table 1 shows aggregate data taken from the source mentioned in the footnotes to the table.
do "${do_path}\11_Table2.do"
do "${do_path}\12_Table3.do"
do "${do_path}\13_Table4.do"
do "${do_path}\14_Table5.do"
do "${do_path}\15_Table6.do"
*These next four scripts need to be run together, they create two log-files with the results in Table 7 and 8, respectively.
do "${do_path}\16_Table7-8_Men_Retirement.do"
do "${do_path}\17_Table7-8_Men_Fertility.do"
do "${do_path}\18_Table7-8_Women_Retirement.do"
do "${do_path}\19_Table7-8_Women_Fertility.do"
*The IV Validity Test by Mourifié and Wan is implemented in Stata. For the test by Guber, please run the do-file to transform the data and then refer to the accompanying R-Script.
do "${do_path}\20_IV_Validity_MourifieWan.do"
do "${do_path}\21_IV_Validity_Guber.do"
*Appendix Material
do "${do_path}\22_FigureA1.do"
do "${do_path}\23_FigA2.do"
do "${do_path}\24_FigA3_A.do"
do "${do_path}\25_FigA3_B.do"
do "${do_path}\26_FigA4.do"
do "${do_path}\27_FigA5.do"
do "${do_path}\28_FigA6.do"
do "${do_path}\29_FigA7.do"
do "${do_path}\30_FigA8.do"
do "${do_path}\31_FigA9-TableA3.do"
do "${do_path}\32_FigA10.do"
*For the simulation study reported in Appendix B.4, first run do-file 33 (THIS CAN TAKE SOME TIME!) and then do-file 34 to produce Figure A11. Please note that we did not set a random seed in the original code, and therefore the results might differ slightly from those reported in Appendix B.4.
do "${do_path}\33_Simulation.do"
do "${do_path}\34_FigA11.do"


do "${do_path}\35_FigA12.do"
do "${do_path}\36_TableA1.do"
do "${do_path}\37_TableA2.do"
*Table A3 is generated together with Figure A9 in script 31
do "${do_path}\38_TableA4.do"
do "${do_path}\39_TableA5.do"
do "${do_path}\40_TableA6.do"
do "${do_path}\41_TableA7.do"
do "${do_path}\42_TableA8.do"










