* read in data use taylor_rule * open log file log using taylor_rule.log, replace * index the data for time series use tsset index *generate ln(gdp) gen gdprl=ln(gdp_r) label var gdprl "ln of real dgp" *get lag of fed fund rate * will use later gen ffr1=ffr[_n-1] label var ffr1 "lag of fed fund rate" *get lag of gdprl * will use later gen gdprl1=gdprl[_n-1] label var gdprl1 "lag of gdprl" * generate 1 year inflation * by taking differene between current * and a 4 period lag * report in percent gen gdp_def4=gdp_def[_n-4] gen inflation=100*(ln(gdp_def)-ln(gdp_def4)) label var inflation "one-year inflation rate in percent" * reduce the data to the post-Greenspan years keep if year>=1987 * run a regression of gdprl on a trend reg gdprl index * output residuals (output gap) predict gdprl_res, residuals * scale gap in percent by * multiplying by 100 gen gap=100*gdprl_res * run taylor rule regression reg ffr inflation gap estat dwatson * test the taylor rule parameters using * an f-test test (gap=0.5) (inflation=1.5)(_cons=1.0) * correct for AR(1) in errors; prais ffr inflation gap, corc twostep test (gap=0.5) (inflation=1.5)(_cons=1.0) log close