---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- name: log: C:\Users\chouse\Dropbox\basu-house\analysis\code\../temp/uc2quart_ipd.log log type: text opened on: 18 Jan 2017, 15:00:49 . /*****************************************************************/ > > /*** NSLY DATA ON USER COST ***/ > /* Do the MATLAB interpolattion */ > /* !del \\lsa-research03.m.storage.umich.edu\lsa-research03\richryan\nlsy\analysis\input\luser_cost_quarterly_interpolated_ipd.csv; */ > > capture confirm file `myinput'luser_cost_quarterly_interpolated_ipd.csv; . if _rc == 0 {; . di "File existed and is now gone."; File existed and is now gone. . erase `myinput'luser_cost_quarterly_interpolated_ipd.csv; . }; . if _rc != 0 {; . di "File did not exist."; . }; . /* !matlab -r run('\\lsa-research03.m.storage.umich.edu\lsa-research03\richryan\nlsy\analysis\code\uc2quart_ipd.m'); */ > !matlab -r run('./uc2quart_ipd.m'); . sleep 10000; . /* sleep 1,000 = 1 second */ > capture confirm file `myinput'luser_cost_quarterly_interpolated_ipd.csv; . while _rc {; 2. /* file does not exist! */ > sleep 1000; 3. capture confirm file `myinput'luser_cost_quarterly_interpolated_ipd.csv; 4. }; . /* Get output from UC2QUART.M */ > import delimited using `myinput'luser_cost_quarterly_interpolated_ipd, clear; (3 vars, 112 obs) . /* merge in CHOW data to extrapolate */ > gen dateq = yq(year,quarter); . format dateq %tq; . merge 1:1 dateq using `myinput'fred4uc2quart_data; (note: variable year was int, now float to accommodate using data's values) (note: variable quarter was byte, now float to accommodate using data's values) Result # of obs. ----------------------------------------- not matched 165 from master 0 (_merge==1) from using 165 (_merge==2) matched 112 (_merge==3) ----------------------------------------- . gen lrgdp = log(rgdp); . gen lempl = log(empl); . gen lcomp = log(comp); . reg lucq ur lrgdp lempl lcomp; Source | SS df MS Number of obs = 112 -------------+---------------------------------- F(4, 107) = 1353.59 Model | 25.3790678 4 6.34476695 Prob > F = 0.0000 Residual | .501546462 107 .00468735 R-squared = 0.9806 -------------+---------------------------------- Adj R-squared = 0.9799 Total | 25.8806142 111 .233158687 Root MSE = .06846 ------------------------------------------------------------------------------ lucq | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- ur | -.0223515 .0075464 -2.96 0.004 -.0373114 -.0073916 lrgdp | 1.608685 .39584 4.06 0.000 .8239783 2.393392 lempl | -1.018385 .5744458 -1.77 0.079 -2.157157 .1203862 lcomp | 2.00754 .3668228 5.47 0.000 1.280357 2.734724 _cons | -9.048117 4.192857 -2.16 0.033 -17.35997 -.7362672 ------------------------------------------------------------------------------ . predict luc; (option xb assumed; fitted values) (4 missing values generated) . replace luc = lucq if !missing(lucq); (112 real changes made) . tsset dateq; time variable: dateq, 1947q1 to 2016q1 delta: 1 quarter . tsline luc, lc(black) lw(1.1) xtitle("") ytitle("Log(Real Dollars)") > ylabel(,angle(h)); . graph export `slides'fig_`prg'_luc.eps, logo(off) replace; (note: file ../../slides/fig_uc2quart_ipd_luc.eps not found) (file ../../slides/fig_uc2quart_ipd_luc.eps written in EPS format) . /*** merge all the data together and output ***/ > /* original data used by the MATLAB program */ > merge m:1 year using `myinput'fixed_effects_ipd_user_cost, nogen; Result # of obs. ----------------------------------------- not matched 161 from master 161 from using 0 matched 116 ----------------------------------------- . rename luc luc_ipd; . la var luc_ipd "LUC, interpolated and extrapolated, IPD, quarterly"; . rename lucq luc_ipd_interp; . la var luc_ipd_interp "LUC, interpolated only, IPD, quarterly"; . rename lUC luc_ipd_fes; . la var luc_ipd_fes "LUC, from fixed effects, annual"; . tsline luc_ipd luc_ipd_interp luc_ipd_fes if tin(1978q1,2005q4), lw(0.8 0.8 0.8) lc(black red mint) > legend(c(3) label(1 "Final Series") label(2 "Interpolated only") label(3 "Time FEs") region(lstyle(none))); . graph export `slides'fig_`prg'_luc_all.eps, logo(off) replace; (note: file ../../slides/fig_uc2quart_ipd_luc_all.eps not found) (file ../../slides/fig_uc2quart_ipd_luc_all.eps written in EPS format) . /* export dataset to Excel */ > export excel year quarter luc_ipd luc_ipd_interp luc_ipd_fes using `myoutput'log_user_cost_quarterly_ipd_all, firstrow(variables) replace; file ../output/log_user_cost_quarterly_ipd_all.xls saved . la var luc_ipd "Log(User Cost) (deflated using IPD)"; . keep year quarter dateq luc_ipd; . save `myinput'log_user_cost_quarterly_ipd, replace; file ../input/log_user_cost_quarterly_ipd.dta saved . save `myoutput'log_user_cost_quarterly_ipd, replace; (note: file ../output/log_user_cost_quarterly_ipd.dta not found) file ../output/log_user_cost_quarterly_ipd.dta saved . export delimited year quarter luc_ipd using `myinput'log_user_cost_quarterly_cpi.csv, delim(",") replace; file ../input/log_user_cost_quarterly_cpi.csv saved . export excel year quarter luc_ipd using `myoutput'log_user_cost_quarterly_ipd.csv, replace; file ../output/log_user_cost_quarterly_ipd.csv saved . end of do-file . do uc2quart_ipd_cumtight.do; . /******************************************************************** > Program: uc2quart_ipd_cumtight.do > Purpose: Take annual measure of user cost and interpolate and > extrapolate to get quarterly series of user cost. > > This version deflates prices using the implicit price deflator from > the NFB sector. The data are based on regressions that control for > match quality a la Hagedorn and Manovskii (2013, AER). > > Date Started: 29 December 2015 > Date Revised: 29 December 2015 > ********************************************************************/ . #delimit ; delimiter now ; . clear all; . set mo off; . set scheme s1mono; . capture log close;