---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- name: log: C:\Users\chouse\Dropbox\basu-house\analysis\code\../temp/plot_user_cost_var.log log type: text opened on: 18 Jan 2017, 15:11:15 . /*********************************************************************************************/ > > /*** Data ***/ > use `myinput'user_cost_var_`samp'_luc_ipd, clear; . merge 1:1 step using `myinput'user_cost_var_`samp'_luc_ipd_cumtght, assert(match) keepusing(oirf_luc_ipd_cumtght stdoirf_luc_ipd_cumtght) nogen; Result # of obs. ----------------------------------------- not matched 0 matched 31 ----------------------------------------- . merge 1:1 step using `myinput'user_cost_var_`samp'_lnh_ipd, assert(match) keepusing(oirf_lnh_ipd stdoirf_lnh_ipd) nogen; Result # of obs. ----------------------------------------- not matched 0 matched 31 ----------------------------------------- . merge 1:1 step using `myinput'user_cost_var_`samp'_lnh_ipd_cumtght, assert(match) keepusing(oirf_lnh_ipd_cumtght stdoirf_lnh_ipd_cumtght) nogen; Result # of obs. ----------------------------------------- not matched 0 matched 31 ----------------------------------------- . export excel samp_begin samp_end step > oirf_fedfunds oirf_lconsumption oirf_linfl oirf_linv oirf_lprod oirf_loutput oirf_lmacrowage_ipd > oirf_lnh_ipd oirf_luc_ipd oirf_luc_ipd_cumtght oirf_lnh_ipd_cumtght > oirf_gm2 oirf_lcp using `myoutput'`prg'_`samp'_data.xlsx, > datestring("%tq") firstrow(variables) sheet("oirf") replace; file ../output/plot_user_cost_var_1965q3_1995q3_data.xlsx saved . export excel samp_begin samp_end step > stdoirf_fedfunds stdoirf_lconsumption stdoirf_linfl stdoirf_linv stdoirf_lprod stdoirf_loutput stdoirf_lmacrowage_ipd > stdoirf_lnh_ipd stdoirf_luc_ipd stdoirf_luc_ipd_cumtght stdoirf_lnh_ipd_cumtght > stdoirf_gm2 stdoirf_lcp using `myoutput'`prg'_`samp'_data.xlsx, > datestring("%tq") firstrow(variables) sheet("stdoirf") sheetmodify; file ../output/plot_user_cost_var_1965q3_1995q3_data.xlsx saved . /*** Plot the data ***/ > tsset step; time variable: step, 0 to 30 delta: 1 unit . foreach ii in fedfunds lconsumption linfl linv lprod loutput {; 2. /* Titles */ > if strmatch("`ii'","fedfunds") {; 3. local mytitle "Fed funds rate"; 4. }; 5. if strmatch("`ii'","lconsumption") {; 6. local mytitle "Consumption"; 7. }; 8. if strmatch("`ii'","linfl") {; 9. local mytitle "Inflation"; 10. }; 11. if strmatch("`ii'","linv") {; 12. local mytitle "Investment"; 13. }; 14. if strmatch("`ii'","lprod") {; 15. local mytitle "Productivity"; 16. }; 17. if strmatch("`ii'","loutput") {; 18. local mytitle "GDP"; 19. }; 20. gen up1 = oirf_`ii' + 1*stdoirf_`ii'; 21. gen up2 = oirf_`ii' + 2*stdoirf_`ii'; 22. gen lo1 = oirf_`ii' - 1*stdoirf_`ii'; 23. gen lo2 = oirf_`ii' - 2*stdoirf_`ii'; 24. tsline oirf_`ii' up1 up2 lo1 lo2 if step <= 20, lw(0.8) lc(black) lp(solid dash dash dash dash) name(`ii', replace) > legend(off) title("`mytitle'") xtitle(""); 25. drop up1 up2 lo1 lo2; 26. }; . graph combine > fedfunds lconsumption linfl > linv lprod loutput, c(3); . graph export `slides'fig_`prg'_standard_variables.eps, logo(off) replace; (note: file ../../slides/fig_plot_user_cost_var_standard_variables.eps not found) (file ../../slides/fig_plot_user_cost_var_standard_variables.eps written in EPS format) . graph close _all; . foreach ii in lmacrowage_ipd lnh_ipd luc_ipd {; 2. if strmatch("`ii'","lmacrowage_ipd") {; 3. local mytitle "Average hourly earnings"; 4. }; 5. if strmatch("`ii'","lnh_ipd") {; 6. local mytitle "New hire wage"; 7. }; 8. if strmatch("`ii'","luc_ipd") {; 9. local mytitle "User cost of labor"; 10. }; 11. gen up1 = oirf_`ii' + 1*stdoirf_`ii'; 12. gen up2 = oirf_`ii' + 2*stdoirf_`ii'; 13. gen lo1 = oirf_`ii' - 1*stdoirf_`ii'; 14. gen lo2 = oirf_`ii' - 2*stdoirf_`ii'; 15. tsline oirf_`ii' up1 up2 lo1 lo2 if step <= 30, lw(0.8) lc(black) lp(solid dash dash dash dash) name(`ii', replace) > legend(off) title("`mytitle'") xtitle(""); 16. drop up1 up2 lo1 lo2; 17. }; . graph combine lmacrowage_ipd lnh_ipd luc_ipd, c(3) ycomm; . graph export `slides'fig_`prg'_real_wages.eps, logo(off) replace; (note: file ../../slides/fig_plot_user_cost_var_real_wages.eps not found) (file ../../slides/fig_plot_user_cost_var_real_wages.eps written in EPS format) . graph close _all; . tsline oirf_lnh_ipd oirf_lnh_ipd_cumtght if step <= 30, lc(black red) lw(0.8 0.8) lp(solid dash) name(nh, replace) xtitle("") > legend(c(1) ring(0) pos(1) label(1 "Unadjusted") label(2 "Adj for match quality")); . tsline oirf_luc_ipd oirf_luc_ipd_cumtght if step <= 30, lc(black red) lw(0.8 0.8) lp(solid dash) name(uc, replace) xtitle("") legend(off); . graph combine nh uc, c(2) ycomm; . graph export `slides'fig_`prg'_cumtight.eps, logo(off) replace; (note: file ../../slides/fig_plot_user_cost_var_cumtight.eps not found) (file ../../slides/fig_plot_user_cost_var_cumtight.eps written in EPS format) . log close; name: log: C:\Users\chouse\Dropbox\basu-house\analysis\code\../temp/plot_user_cost_var.log log type: text closed on: 18 Jan 2017, 15:11:24 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------