PAR 500 * Design Matrix SAMPLE 1 20 READ X1 X2 / LIST 14.53 16.74 15.30 16.81 15.92 19.50 17.41 22.12 18.37 22.34 18.83 17.47 18.84 20.24 19.71 20.37 20.01 12.71 20.26 22.98 20.77 19.33 21.17 17.04 21.34 16.74 22.91 19.81 22.96 31.92 23.69 26.31 24.82 25.93 25.54 21.96 25.63 24.05 28.73 25.66 * Generate 1000 samples with true model: Y = 10 + X1 + X2 + e * where e is an AR(1) process with: e = 0.8*e(-1) + v * and v is independent normally distributed with 0 mean and var.=6.4. GEN1 SE=SQRT(6.4) * Allocate arrays to hold the estimates DIM BOLS 4 1000 STDOLS 4 1000 BGLS 4 1000 STDGLS 4 1000 DIM BEGLS 4 1000 STDEG 4 1000 * Request the same set of random numbers in repeated runs SET RANFIX * Suppress useless output SET NODOECHO DO #=1,1000 SAMPLE 1 20 * Generate v GENR V=NOR(SE) * Set an initial condition for e GENR E=0 * Generate e - recursive calculations SAMPLE 2 20 GENR E=0.8*LAG(E)+V SAMPLE 1 20 * Generate Y given X and e. GENR Y=10+X1+X2+E * OLS estimation, suppress the output with ? ?OLS Y X1 X2 / COEF=BOLS:# STDERR=STDOLS:# * GLS estimation (RHO is known) ?AUTO Y X1 X2 / RHO=0.8 COEF=BGLS:# STDERR=STDGLS:# * Estimated GLS (RHO is estimated - iterated Cochrane-Orcutt) ?AUTO Y X1 X2 / COEF=BEGLS:# STDERR=STDEG:# ENDO * Transpose the arrays so that the STAT command can be used MATRIX BOLS=BOLS' MATRIX STDOLS=STDOLS' MATRIX BGLS=BGLS' MATRIX STDGLS=STDGLS' MATRIX BEGLS=BEGLS' MATRIX STDEG=STDEG' SAMPLE 1 1000 STAT BOLS BGLS BEGLS / MEAN=B STDEV=ASE STAT STDOLS STDGLS STDEG / MEAN=ESE STDEV=STDSE SAMPLE 1 12 FORMAT(4F12.4) PRINT B ASE ESE STDSE / FORMAT STOP