options crt; ? 6e2 in kopcke; freq q; dot e s; smpl 56:1,86:4; regopt(pvprint) dh dhalt; ? on by default in TSP 4.4 and later olsq i. c y y(-1) i.(-1); set varli = @ses(4)**2; ? for (b) ? Save Durbin's h diagnostics; otherwise they will be overwritten ? when Durbin's m equation is estimated. rename @dh dh; rename %dh pdh; rename @dhalt dhalt1; rename %dhalt %dhalt1; frml eql lambda = 1-i.(-1); frml eqm mu = y/(1-i.(-1)); frml eqd delta = y(-1)/y + 1; analyz eql eqm eqd; ? (a) main part ? ? Some early releases of TSP 4.4 don't calculate @dw when there ? is a lagged dependent variable on the RHS, but we can still ? compute it from the residuals. ? olsq(silent) @res c; set rhodw = 1 - @dw/2; print rhodw; ? ? durbh will not match @dh exactly, because TSP calculates rho ? from the regression of @res on @res(-1), instead of the 1-dw/2 formula. ? set durbh = rhodw*sqrt(@nob/(1-@nob*varli)); print dh,pdh,durbh; ? (b) smpl 56:2,86:4; olsq @res @res(-1) c y y(-1) i.(-1); set rhom = @coef(1); print rhom rhodw durbh; set durbm = @t(1); print durbm; ? (b) for verification of Durbin's h alt. print dhalt1,%dhalt1; ? smpl 56:1,86:4; ar1(method=hilu,rmin=0,rmax=1,rstep=.05) i. c y y(-1) i.(-1); set min2 = @rho-.05; set max2 = @rho+.05; ? new narrower grid ar1(method=hilu,rmin=min2,rmax=max2,rstep=.01) i. c y y(-1) i.(-1); analyz eql eqm eqd; ? (c) set rhohilu = @rho; ? ar1(method=corc) i. c y y(-1) i.(-1); analyz eql eqm eqd; ? (d) set rhocorc = @rho; print rhohilu,rhocorc; enddot;