*==============================================================================* * Advanced Applied Econometrics * Jakub Muck * Exercise 19 * importing data clear all use "http://e-web.sgh.waw.pl/jmuck/AAE/Datasets/USPhillipsCurve.dta" * data preparation sort year quarter gen t=_n tsset t gen cpi=ln(CPI) gen infl=d.cpi * (i) Stationarity tsline infl dfuller infl, lags(1) regress * (ii) AR(1) model reg infl L.infl * serial correlation estat bgodfrey, lags(1/4) * half-life nlcom(half_lif:ln(.5)/ln(_b[L.infl])) * IRF => available only for the ML estimates arima infl, ar(1) irf create ar1, set(myirf) replace step(20) irf graph irf * (iii) AR(2) model reg infl L(1/2).infl * serial correlation estat bgodfrey, lags(1/4) * IRF => available only for the ML estimates arima infl, ar(1/2) irf create ar2, set(myirf) replace step(20) irf graph irf * (iv) AR(3) and AR(4) model reg infl L(1/3).infl * serial correlation estat bgodfrey, lags(1/4) * IRF => available only for the ML estimates arima infl, ar(1/3) irf create ar3, set(myirf) replace step(20) irf graph irf reg infl L(1/4).infl * serial correlation estat bgodfrey, lags(1/4) * IRF => available only for the ML estimates arima infl, ar(1/4) irf create ar4, set(myirf) replace step(20) irf graph irf