* * MONTEARCH.RPF * RATS Version 8, User's Guide, Example 16.1 * compute ndraws=10000,useobs=100,endobs=50+useobs all endobs set x 1 endobs = t * compute sigma=1.0,alpha =.20 frml(variance=sigma^2) vdef v = 0.0 frml(identity) udef u = v*sqrt(1+alpha*u{1}^2) frml(identity) ydef y = 2.0 + 3.0*x + u group archmod vdef udef ydef>>y * set u 1 1 = 0.0 set teststat 1 ndraws = 0.0 do draw=1,ndraws simulate(model=archmod) 2 endobs-1 2 linreg(noprint) y 51 endobs resids # constant x set usquared 51 endobs = resids^2 linreg(noprint) usquared 52 endobs # constant usquared{1} compute teststat(draw)=%trsquared end do draw stats(fractiles,nomoments) teststat * * Display the .05 rejection levels using the simulated test * statistics and the asymptotic chi-squared distribution. * disp "Simulated .05 Rejection Limit" @35 %fract95 disp "Asymptotic .05 Rejection Limit" @35 %invchisqr(.05,1)