* R. Carter Hill, William E. Griffiths and Guay C. Lim, * Principles of Econometrics, Fourth Edition, Wiley, 2011. * Repeated Sampling Experiment * Chapter 2.4.3 (p. 59) * Chapter 3.1.4 (pp. 99-100) SAMPLE 1 40 READ (table2_2.dat) / names * 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 sampNum=TIME(0) FORMAT(F10.0,5F10.2) NAMEFMT(6X,6(A8,2X)) * Print the results (Table 2.2, p. 59) PRINT sampNum b1 b2 / FORMAT * Get the average estimates from the 10 samples (p. 59) STAT b1 b2 * Print more results (Table 3.1, p. 99) PRINT sampNum b1 se1 b2 se2 sig2 / FORMAT * Get a t-distribution critical value for a 95% confidence interval GEN1 alpha=0.05/2 DISTRIB alpha / TYPE=T DF=38 INVERSE GEN1 tcrit=\$CRIT PRINT tcrit * Calculate interval estimates (Table 3.2, p. 100) GENR b1LOW=b1-tcrit*se1 GENR b2LOW=b2-tcrit*se2 GENR b1UP=b1+tcrit*se1 GENR b2UP=b2+tcrit*se2 PRINT sampNum b1LOW b1UP b2LOW b2UP / FORMAT STOP