---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- name: log: C:\Users\chouse\Dropbox\basu-house\analysis\code\../temp/cycregs_ipd_cumtight.log log type: text opened on: 18 Jan 2017, 15:00:49 . /***********************************************************************************/ > /*** DATA ***/ > /***********************************************************************************/ > local deflator ipd; . local start_year = 1978; . use `myinput'fixed_effects_`deflator'_cumtight_data, clear; . /* keep if regexm(var,"^[0-9]"); /\* var starts with a number *\/ */ > /* gen year = substr(var,1,4); */ > /* destring year, replace; */ > > /* gen base = substr(var,5,1); */ > /* drop if base == "b"; */ > /* assert coef != 0; */ > > keep if regexm(var,"^[0-9]") | var=="_cons"; (31 observations deleted) . /* var starts with a number */ > drop if var == "1978b.datey"; (3 observations deleted) . replace var = "1978" if var == "_cons"; (3 real changes made) . gen year = substr(var,1,4); . destring year, replace; year has all characters numeric; replaced as int . /* gen base = substr(var,5,1); */ > /* drop if base == "b"; */ > assert coef != 0; . keep coef year scenario; . reshape wide coef, i(year) j(scenario) s; (note: j = base cntrl cntrlfes) Data long -> wide ----------------------------------------------------------------------------- Number of obs. 78 -> 26 Number of variables 3 -> 4 j variable (3 values) scenario -> (dropped) xij variables: coef -> coefbase coefcntrl coefcntrlfes ----------------------------------------------------------------------------- . sort year; . foreach ii in base cntrl cntrlfes {; 2. gen temp1 = coef`ii' in 1; 3. egen temp2 = max(temp1); 4. replace coef`ii' = coef`ii' + temp2 if year > `start_year'; 5. drop temp1 temp2; 6. }; (25 missing values generated) (25 real changes made) (25 missing values generated) (25 real changes made) (25 missing values generated) (25 real changes made) . merge 1:1 year using `myinput'fred4cycregs_data, gen(match_fred); (note: variable year was int, now float to accommodate using data's values) Result # of obs. ----------------------------------------- not matched 42 from master 0 (match_fred==1) from using 42 (match_fred==2) matched 26 (match_fred==3) ----------------------------------------- . merge 1:1 year using `myinput'fixed_effects_`deflator'_cumtight_user_cost, gen(match_uc); Result # of obs. ----------------------------------------- not matched 39 from master 39 (match_uc==1) from using 0 (match_uc==2) matched 29 (match_uc==3) ----------------------------------------- . merge 1:1 year using `myinput'fixed_effects_`deflator'_cumtight_entry_wage, gen(match_entry_wage); Result # of obs. ----------------------------------------- not matched 42 from master 42 (match_entry_wage==1) from using 0 (match_entry_wage==2) matched 26 (match_entry_wage==3) ----------------------------------------- . /*******************/ > drop if year == 1978; (1 observation deleted) . /*******************/ > > /*** multiply UR coefficients by 100 ***/ > replace ur = ur/100; (66 real changes made) . replace hp_ur = hp_ur/100; (66 real changes made) . tsset year; time variable: year, 1947 to 2014, but with a gap delta: 1 unit . #delimit cr delimiter now cr . foreach ii in base cntrl cntrlfes { 2. /*** UR ***/ . reg coef`ii' ur year, vce(hc3) 3. if strmatch("`ii'","base") { 4. est sto m`ii'ur, title("Base") 5. } 6. if strmatch("`ii'","cntrl") { 7. est sto m`ii'ur, title("Controls") 8. } 9. if strmatch("`ii'","cntrlfes") { 10. est sto m`ii'ur, title("Controls, FEs") 11. } 12. . /*** HP UR ***/ . reg coef`ii' hp_ur year, vce(hc3) 13. if strmatch("`ii'","base") { 14. est sto m`ii'_hp_ur, title("Base") 15. } 16. if strmatch("`ii'","cntrl") { 17. est sto m`ii'_hp_ur, title("Controls") 18. } 19. if strmatch("`ii'","cntrlfes") { 20. est sto m`ii'_hp_ur, title("Controls, FEs") 21. } 22. . /*** GDP ***/ . reg coef`ii' hp_lrgdp_twiddle year, vce(hc3) 23. if strmatch("`ii'","base") { 24. est sto m`ii'_gdp, title("Base") 25. } 26. if strmatch("`ii'","cntrl") { 27. est sto m`ii'_gdp, title("Controls") 28. } 29. if strmatch("`ii'","cntrlfes") { 30. est sto m`ii'_gdp, title("Controls, FEs") 31. } 32. } Linear regression Number of obs = 25 F(2, 22) = 808.57 Prob > F = 0.0000 R-squared = 0.9880 Root MSE = .06681 ------------------------------------------------------------------------------ | Robust HC3 coefbase | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- ur | 1.143704 .9226882 1.24 0.228 -.7698346 3.057242 year | .0590613 .0021974 26.88 0.000 .0545043 .0636183 _cons | -114.9723 4.427853 -25.97 0.000 -124.1551 -105.7895 ------------------------------------------------------------------------------ Linear regression Number of obs = 25 F(2, 22) = 584.66 Prob > F = 0.0000 R-squared = 0.9874 Root MSE = .06839 ------------------------------------------------------------------------------ | Robust HC3 coefbase | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- hp_ur | -1.039075 1.832857 -0.57 0.577 -4.840188 2.762038 year | .0587417 .0020855 28.17 0.000 .0544165 .0630668 _cons | -114.2596 4.155508 -27.50 0.000 -122.8776 -105.6416 ------------------------------------------------------------------------------ Linear regression Number of obs = 25 F(2, 22) = 396.19 Prob > F = 0.0000 R-squared = 0.9876 Root MSE = .06774 ---------------------------------------------------------------------------------- | Robust HC3 coefbase | Coef. Std. Err. t P>|t| [95% Conf. Interval] -----------------+---------------------------------------------------------------- hp_lrgdp_twiddle | 1.000457 1.682403 0.59 0.558 -2.488634 4.489548 year | .0586039 .0021489 27.27 0.000 .0541473 .0630605 _cons | -113.9859 4.283593 -26.61 0.000 -122.8696 -105.1023 ---------------------------------------------------------------------------------- Linear regression Number of obs = 25 F(2, 22) = 0.61 Prob > F = 0.5500 R-squared = 0.0910 Root MSE = .06186 ------------------------------------------------------------------------------ | Robust HC3 coefcntrl | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- ur | .8673201 .7956112 1.09 0.287 -.7826765 2.517317 year | .001671 .0018702 0.89 0.381 -.0022077 .0055496 _cons | -2.596574 3.766766 -0.69 0.498 -10.40837 5.21522 ------------------------------------------------------------------------------ Linear regression Number of obs = 25 F(2, 22) = 1.02 Prob > F = 0.3755 R-squared = 0.0759 Root MSE = .06237 ------------------------------------------------------------------------------ | Robust HC3 coefcntrl | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- hp_ur | -1.092518 1.728949 -0.63 0.534 -4.678139 2.493103 year | .0014562 .0018057 0.81 0.429 -.0022885 .0052009 _cons | -2.111034 3.599675 -0.59 0.564 -9.576303 5.354234 ------------------------------------------------------------------------------ Linear regression Number of obs = 25 F(2, 22) = 0.50 Prob > F = 0.6151 R-squared = 0.0803 Root MSE = .06222 ---------------------------------------------------------------------------------- | Robust HC3 coefcntrl | Coef. Std. Err. t P>|t| [95% Conf. Interval] -----------------+---------------------------------------------------------------- hp_lrgdp_twiddle | .8448961 1.568064 0.54 0.595 -2.407069 4.096862 year | .0013204 .0018553 0.71 0.484 -.0025272 .0051679 _cons | -1.841155 3.700511 -0.50 0.624 -9.515545 5.833234 ---------------------------------------------------------------------------------- Linear regression Number of obs = 25 F(2, 22) = 735.31 Prob > F = 0.0000 R-squared = 0.9868 Root MSE = .06706 ------------------------------------------------------------------------------ | Robust HC3 coefcntrlfes | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- ur | .9305219 .9158577 1.02 0.321 -.9688507 2.829895 year | .0564617 .002197 25.70 0.000 .0519054 .0610179 _cons | -110.4435 4.426075 -24.95 0.000 -119.6226 -101.2643 ------------------------------------------------------------------------------ Linear regression Number of obs = 25 F(2, 22) = 517.84 Prob > F = 0.0000 R-squared = 0.9867 Root MSE = .06737 ------------------------------------------------------------------------------ | Robust HC3 coefcntrlfes | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- hp_ur | -1.294978 1.764348 -0.73 0.471 -4.954011 2.364056 year | .0562424 .0020606 27.29 0.000 .0519689 .0605159 _cons | -109.9447 4.105869 -26.78 0.000 -118.4597 -101.4296 ------------------------------------------------------------------------------ Linear regression Number of obs = 25 F(2, 22) = 373.31 Prob > F = 0.0000 R-squared = 0.9868 Root MSE = .06696 ---------------------------------------------------------------------------------- | Robust HC3 coefcntrlfes | Coef. Std. Err. t P>|t| [95% Conf. Interval] -----------------+---------------------------------------------------------------- hp_lrgdp_twiddle | 1.069896 1.630876 0.66 0.519 -2.312333 4.452126 year | .0560784 .0021006 26.70 0.000 .0517219 .0604348 _cons | -109.6189 4.187676 -26.18 0.000 -118.3036 -100.9342 ---------------------------------------------------------------------------------- . #delimit ; delimiter now ; . la var hp_ur "HP UR"; . la var year "Trend"; . la var ur "Unemployment Rate"; . la var hp_lrgdp_twiddle "HP GDP"; . /*** UR ***/ > reg lmacrowage_`deflator' ur year if year >= 1978 & year <= 2012; Source | SS df MS Number of obs = 34 -------------+---------------------------------- F(2, 31) = 800.42 Model | 1.14860454 2 .574302268 Prob > F = 0.0000 Residual | .022242563 31 .000717502 R-squared = 0.9810 -------------+---------------------------------- Adj R-squared = 0.9798 Total | 1.1708471 33 .035480215 Root MSE = .02679 ------------------------------------------------------------------------------ lmacrowage~d | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- ur | -.2682393 .287129 -0.93 0.357 -.8538428 .3173641 year | .0186686 .0004728 39.49 0.000 .0177044 .0196328 _cons | -32.88366 .9461207 -34.76 0.000 -34.81328 -30.95403 ------------------------------------------------------------------------------ . est sto macro_ur, title("Macro Wage"); . reg lUC ur year; Source | SS df MS Number of obs = 27 -------------+---------------------------------- F(2, 24) = 345.56 Model | 5.58628297 2 2.79314149 Prob > F = 0.0000 Residual | .193991649 24 .008082985 R-squared = 0.9664 -------------+---------------------------------- Adj R-squared = 0.9636 Total | 5.78027462 26 .222318255 Root MSE = .08991 ------------------------------------------------------------------------------ lUC | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- ur | -2.416423 1.674056 -1.44 0.162 -5.871505 1.038659 year | .0553743 .0030122 18.38 0.000 .0491576 .0615911 _cons | -107.6091 6.070788 -17.73 0.000 -120.1386 -95.07961 ------------------------------------------------------------------------------ . est sto lUC_ur, title("L(User Cost)"); . reg lentry_wage ur year; Source | SS df MS Number of obs = 25 -------------+---------------------------------- F(2, 22) = 653.60 Model | 9.67727442 2 4.83863721 Prob > F = 0.0000 Residual | .162867214 22 .007403055 R-squared = 0.9834 -------------+---------------------------------- Adj R-squared = 0.9819 Total | 9.84014163 24 .410005901 Root MSE = .08604 ------------------------------------------------------------------------------ lentry_wage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- ur | 1.321685 1.164247 1.14 0.268 -1.092816 3.736186 year | .0647002 .0018264 35.42 0.000 .0609125 .0684879 _cons | -126.3034 3.65818 -34.53 0.000 -133.89 -118.7168 ------------------------------------------------------------------------------ . est sto lentry_ur, title("New Hire"); . esttab macro_ur mbaseur mcntrlur mcntrlfesur lentry_ur lUC_ur using `slides'tab_`prg'_1978_2012_ur.tex, replace > keep(ur) > addnotes("Uses year FEs from a first-stage regression.") > star(* 0.10 ** 0.05 *** 0.01) > booktabs se label mtitles nogap; (note: file ../../slides/tab_cycregs_ipd_cumtight_1978_2012_ur.tex not found) (output written to ../../slides/tab_cycregs_ipd_cumtight_1978_2012_ur.tex) . /*** HP_UR ***/ > reg lmacrowage_`deflator' hp_ur year if year >= 1978 & year <= 2012; Source | SS df MS Number of obs = 34 -------------+---------------------------------- F(2, 31) = 807.81 Model | 1.14880429 2 .574402143 Prob > F = 0.0000 Residual | .022042815 31 .000711059 R-squared = 0.9812 -------------+---------------------------------- Adj R-squared = 0.9800 Total | 1.1708471 33 .035480215 Root MSE = .02667 ------------------------------------------------------------------------------ lmacrowage~d | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- hp_ur | -.5078002 .4711603 -1.08 0.289 -1.468738 .4531376 year | .0187981 .0004705 39.96 0.000 .0178386 .0197576 _cons | -33.15892 .9387707 -35.32 0.000 -35.07356 -31.24428 ------------------------------------------------------------------------------ . est sto macro_hp_ur, title("Macro Wage"); . reg lUC hp_ur year; Source | SS df MS Number of obs = 27 -------------+---------------------------------- F(2, 24) = 391.39 Model | 5.60832327 2 2.80416164 Prob > F = 0.0000 Residual | .171951346 24 .007164639 R-squared = 0.9703 -------------+---------------------------------- Adj R-squared = 0.9678 Total | 5.78027462 26 .222318255 Root MSE = .08464 ------------------------------------------------------------------------------ lUC | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- hp_ur | -4.772446 2.04864 -2.33 0.029 -9.000632 -.5442605 year | .0585297 .0020935 27.96 0.000 .0542089 .0628506 _cons | -114.0439 4.170327 -27.35 0.000 -122.6511 -105.4368 ------------------------------------------------------------------------------ . est sto lUC_hp_ur, title("L(User Cost)"); . reg lentry_wage hp_ur year; Source | SS df MS Number of obs = 25 -------------+---------------------------------- F(2, 22) = 620.80 Model | 9.66881911 2 4.83440955 Prob > F = 0.0000 Residual | .171322527 22 .007787388 R-squared = 0.9826 -------------+---------------------------------- Adj R-squared = 0.9810 Total | 9.84014163 24 .410005901 Root MSE = .08825 ------------------------------------------------------------------------------ lentry_wage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- hp_ur | -.6910376 1.851062 -0.37 0.712 -4.529906 3.147831 year | .0642846 .0018304 35.12 0.000 .0604886 .0680807 _cons | -125.3878 3.647648 -34.37 0.000 -132.9526 -117.8231 ------------------------------------------------------------------------------ . est sto lentry_hp_ur, title("New Hire"); . esttab macro_hp_ur mbase_hp_ur mcntrl_hp_ur mcntrlfes_hp_ur lentry_hp_ur lUC_hp_ur using `slides'tab_`prg'_1978_2012_hp_ur.tex, replace > keep(hp_ur) > b(%9.3f) > nostar /* star(* 0.10 ** 0.05 *** 0.01) */ > /* addnotes("Uses year FEs from a first-stage regression.") */ > booktabs se label mtitles nogap; (note: file ../../slides/tab_cycregs_ipd_cumtight_1978_2012_hp_ur.tex not found) (output written to ../../slides/tab_cycregs_ipd_cumtight_1978_2012_hp_ur.tex) . /*** HP filtered real GDP ***/ > reg lmacrowage_`deflator' hp_lrgdp_twiddle year if year >= 1978 & year <= 2012; Source | SS df MS Number of obs = 34 -------------+---------------------------------- F(2, 31) = 798.03 Model | 1.14853911 2 .574269555 Prob > F = 0.0000 Residual | .02230799 31 .000719613 R-squared = 0.9809 -------------+---------------------------------- Adj R-squared = 0.9797 Total | 1.1708471 33 .035480215 Root MSE = .02683 ---------------------------------------------------------------------------------- lmacrowage_ipd | Coef. Std. Err. t P>|t| [95% Conf. Interval] -----------------+---------------------------------------------------------------- hp_lrgdp_twiddle | .3117766 .3531823 0.88 0.384 -.4085434 1.032097 year | .0187433 .0004692 39.95 0.000 .0177864 .0197002 _cons | -33.04986 .9362811 -35.30 0.000 -34.95941 -31.1403 ---------------------------------------------------------------------------------- . est sto macro_gdp, title("Macro Wage"); . reg lUC hp_lrgdp_twiddle year; Source | SS df MS Number of obs = 27 -------------+---------------------------------- F(2, 24) = 357.04 Model | 5.59231982 2 2.79615991 Prob > F = 0.0000 Residual | .187954801 24 .00783145 R-squared = 0.9675 -------------+---------------------------------- Adj R-squared = 0.9648 Total | 5.78027462 26 .222318255 Root MSE = .0885 ---------------------------------------------------------------------------------- lUC | Coef. Std. Err. t P>|t| [95% Conf. Interval] -----------------+---------------------------------------------------------------- hp_lrgdp_twiddle | 2.283562 1.33605 1.71 0.100 -.4739099 5.041035 year | .0585005 .0021894 26.72 0.000 .0539818 .0630191 _cons | -113.9854 4.361274 -26.14 0.000 -122.9866 -104.9841 ---------------------------------------------------------------------------------- . est sto lUC_gdp, title("L(User Cost)"); . reg lentry_wage hp_lrgdp_twiddle year; Source | SS df MS Number of obs = 25 -------------+---------------------------------- F(2, 22) = 642.54 Model | 9.6745179 2 4.83725895 Prob > F = 0.0000 Residual | .165623737 22 .007528352 R-squared = 0.9832 -------------+---------------------------------- Adj R-squared = 0.9816 Total | 9.84014163 24 .410005901 Root MSE = .08677 ---------------------------------------------------------------------------------- lentry_wage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -----------------+---------------------------------------------------------------- hp_lrgdp_twiddle | 1.244893 1.311402 0.95 0.353 -1.474789 3.964575 year | .0641678 .001793 35.79 0.000 .0604492 .0678863 _cons | -125.1559 3.5732 -35.03 0.000 -132.5662 -117.7455 ---------------------------------------------------------------------------------- . est sto lentry_gdp, title("New Hire"); . esttab macro_gdp mbase_gdp mcntrl_gdp mcntrlfes_gdp lentry_gdp lUC_gdp using `slides'tab_`prg'_1978_2012_gdp.tex, replace > keep(hp_lrgdp_twiddle) > b(%9.3f) > nostar /* star(* 0.10 ** 0.05 *** 0.01) */ > /* addnotes("Uses year FEs from a first-stage regression.") */ > booktabs se label mtitles nogap; (note: file ../../slides/tab_cycregs_ipd_cumtight_1978_2012_gdp.tex not found) (output written to ../../slides/tab_cycregs_ipd_cumtight_1978_2012_gdp.tex) . /*** Output data ***/ > rename coefbase wbase_`deflator'; . rename coefcntrl wcntrl_`deflator'; . rename coefcntrlfes wcntrlfes_`deflator'; . rename lUC lUC_`deflator'; . rename lentry_wage lnewhire_`deflator'; . keep year wbase_`deflator' wcntrl_`deflator' wcntrlfes_`deflator' lmacrowage_`deflator' lUC_`deflator' lnewhire_`deflator'; . drop if year < 1978; (31 observations deleted) . export excel `myoutput'`prg'_data.xlsx, replace firstrow(variables); file ../output/cycregs_ipd_cumtight_data.xlsx saved . end of do-file . do uc2quart_ipd.do; . /******************************************************************** > Program: uc2quart_ipd.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. > > Date Started: 7 September 2015 > Date Revised: 12 July 2016 > ********************************************************************/ . #delimit ; delimiter now ; . clear all; . set mo off; . set scheme s1mono; . capture log close;