use "C:\DATA\stata\poe\bangla.dta", clear gen time = _n tsset time, yearly gen lp = log(p) gen la = log(a) regress la lp predict ehat, residual twoway (scatter ehat time) more * -------------------------------------------------- * Correlation between least sqaures residuals * -------------------------------------------------- gen ehat_1 = ehat[_n-1] correlate ehat ehat_1 * -------------------------------------------------- * regression with HAC standard errors * B is the computed bandwidth (which = 3) * -------------------------------------------------- scalar B = round(4*(e(N)/100)^(2/9)) scalar list B newey la lp, lag(3) * -------------------------------------------------- * Nonlinear least squares of AR(1) regression model * -------------------------------------------------- gen la_1 = L.la gen lp_1 = L.lp nl (la = {b1}*(1-{rho}) + {b2}*lp + {rho}*la_1 - {rho}*{b2}*(lp_1)), variables(lp la la_1 lp_1) * -------------------------------------------------- * FGLS estimation of AR(1) regression model, 2-step PW * -------------------------------------------------- prais la lp, twostep * -------------------------------------------------- * FGLS estimation of AR(1) regression model, iterated PW * -------------------------------------------------- prais la lp, nolog * -------------------------------------------------- * ML estimation of AR(1) regression model * -------------------------------------------------- arima la lp, arima(1,0,0)