* * Example from chapter 6, pp 265-291 * open data bankdata.dat calendar(m) 1988:2 data(format=free,org=columns) 1988:2 1993:1 eom aaa govt34 * set deom = eom{-1}-eom set d34 = govt34{-1}-govt34 * linreg deom * 53 # constant aaa govt34 d34 * graph(footer="Figure 6-7: Time Plot of Residuals") # %resids * * The procedure REGCORRS graphs the autocorrelations of a series, generally used * for residuals. * @regcorrs(footer="ACF of model residuals") * * The SEASONALS instruction creates a dummy seasonal variable It can create a * dummy for any specific month, but the default is to create it as a dummy for * the first month in the date scheme; in this case, February. (The data begin * 1988:2). The other months are usually gotten by using leads of this. The first * lead will be January, the second December, ... To get the set of dummies used * in the regression in the text you want leads -1 to -11. (January through March). * seasonals seasons linreg deom * 53 # constant aaa govt34 d34 seasons{-1 to -11} graph(footer="Figure 6-8 Residuals from model with dummy variables") # %resids @regcorrs * set trend = t set trend2 = t**2 set trend3 = t**3 * * The RATS instruction STWISE does stepwise regression (pp 285-287). The SLSTAY * and SLENTER options fix a significance level to stay in the regression (in the * backward pruning step) and to enter the regression (in the forward selection). * These are set to the .10 values used in generating table 6-11 (the default * values for both are .20). The FORCE=1 option forces the first regressor on the * list (the CONSTANT) into all regressions. * stwise(method=stepwise,slstay=0.10,slenter=0.10,force=1) deom * 53 # constant aaa govt34 d34 seasons{-11 to -1} trend trend2 trend3