* * Monte Carlo anslysis from page 351 * compute ndraws=10000 compute nobs =123 all nobs * * The 2SLS coefficients and t-statistics are put into "ndraws" entries of the * series b and tstat. It's often easier to analyze the output when it's in a * series. * set b 1 ndraws = 0.0 set tstat 1 ndraws = 0.0 do draws=1,ndraws set(first=0.0) e = %ran(1.0) accumulate e set c = 100+e set y = c-c{1} set x = c**2-c{1}**2 instruments x{1} linreg(noprint,inst) y # x compute b(draws)=%beta(1),tstat(draws)=%tstats(1) end do draws * stats(fractiles) b stats(fractiles) tstat * * Figure 11.2 is clearly not matching table 11.1. However, cutting out the * extreme values does seem to be necessary with these results as well. * stats(fractiles) b set smpl 1 ndraws = b>=%fract05.and.b<=%fract95 density(smpl=smpl) b 1 ndraws xb fb scatter(style=line,footer="Figure 11.2 Distribution of 2SLS estimate") # xb fb