* R. Carter Hill, William E. Griffiths and Guay C. Lim, * Principles of Econometrics, Third Edition, Wiley, 2008. * Repeated Sampling Experiment * Chapter 2.4.3 (pp. 28-9) * Chapter 3.1.4 (pp. 53-4) SAMPLE 1 40 READ (table2-2.shd) x y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 * Use the DIM command to create variables for saving results DIM B1 10 B2 10 SE1 10 SE2 10 SIG2 10 * Use a DO-loop for repeated estimations SET NODOECHO NOOUTPUT DO #=1,10 OLS Y# X / COEF=B STDERR=SE * The error variance estimate is saved in the temporary variable $SIG2 GEN1 SIG2:#=$SIG2 GEN1 B1:#=B:2 GEN1 B2:#=B:1 GEN1 SE1:#=SE:2 GEN1 SE2:#=SE:1 ENDO SET OUTPUT SAMPLE 1 10 GENR SAMPLE=TIME(0) FORMAT(F10.0,5F10.2) NAMEFMT(6X,6(A8,2X)) * Print the results (Table 2.2, p. 28) PRINT SAMPLE B1 B2 / FORMAT * Get the average estimates from the 10 samples (p. 29) STAT B1 B2 * Print more results (Table 3.1, p. 53) PRINT SAMPLE B1 SE1 B2 SE2 SIG2 / FORMAT * Calculate interval estimates (Table 3.2, p. 54) GEN1 TCRIT=2.024 GENR B1LOW=B1-TCRIT*SE1 GENR B2LOW=B2-TCRIT*SE2 GENR B1UP=B1+TCRIT*SE1 GENR B2UP=B2+TCRIT*SE2 PRINT SAMPLE B1LOW B1UP B2LOW B2UP / FORMAT STOP