program grunfeld_short infile using "grunfeld_short.dct",clear summ * describe tsset year * list reg3 (gmi gmf gmc) (ci cf cc) (usi usf usc) (gei gef gec) (wi wf wc), ols reg3 (gmi gmf gmc) (ci cf cc) (usi usf usc) (gei gef gec) (wi wf wc), sur end program grunfeld_fe infile using "grunfeld_short_t.dct",clear * list summ * test test gen n=_n tsset n xtset firm year xtdescribe xtsum * old Model regress i f c predict olshat predict olsres, resid display " MAD Model " qreg i f c predict medhat predict medres, resid gen maderror = i-olshat display "Show how OLS and MAD deal with last 20 obs" list year firm i f c olshat medhat olsres medres * FE xtreg i f c, fe xtreg i f c, re end program grunfeld_long infile using "grunfeld.dct",clear summ tsset year_1 * list reg3 (i_gm f_gm c_gm ) /// (i_uss f_uss c_uss ) /// (i_ge f_ge c_ge ) /// (i_chry f_chry c_chry ) /// (i_atl f_atl c_atl ) /// (i_ibm f_ibm c_ibm ) /// (i_uoil f_uoil c_uoil ) /// (i_west f_west c_west ) /// (i_goody f_goody c_goody ) /// (i_dmatch f_dmatch c_dmatch), ols reg3 (i_gm f_gm c_gm ) /// (i_uss f_uss c_uss ) /// (i_ge f_ge c_ge ) /// (i_chry f_chry c_chry ) /// (i_atl f_atl c_atl ) /// (i_ibm f_ibm c_ibm ) /// (i_uoil f_uoil c_uoil ) /// (i_west f_west c_west ) /// (i_goody f_goody c_goody ) /// (i_dmatch f_dmatch c_dmatch), sur end program quantiles * we look at coefficients across quantiles display "Compare OLS and 2-4 coef across quantiles. Bootstrap se" infile using "grunfeld_short_t.dct",clear summ describe display "We show OLS and MAD results only" regress i c f estimates store OLS quietly qreg i c f, quantile(.25) estimates store QR_25 qreg i c f, quantile(.50) estimates store QR_50 quietly qreg i c f, quantile(.75) estimates store QR_75 set seed 10101 quietly bsqreg i c f, quant(.50) reps(400) estimates store BSQR_50 estimates table OLS QR_25 QR_50 QR_75 BSQR_50, se end * SUR Model on reduced number of firms * grunfeld_short * SUR model on full sample * grunfeld_long * Fixed Effects / Random effects grunfeld_fe * Quantiles * quantiles