!nrep=10000 !n=50 smpl 1 !n rndseed 123456 scalar b1=1 scalar b2=5 series y vector(!nrep) t2 scalar crit10 = @qnorm(0.90) ' This is the 10% critical value for a 1-sided test assuming (asymptotic) Normality scalar crit05 = @qnorm(0.95) ' This is the 5% critical value for a 1-sided test assuming (asymptotic) Normality scalar crit01 = @qnorm(0.99) ' This is the 1% critical value for a 1-sided test assuming (asymptotic) Normality ' These are just for comparative purposes for !i=1 to !nrep c(1) = 1 ' This is to ensure sensible starting values for the non-linear estimation c(2) = 1 y=b1+(b2*x3)^b1+@rnorm * z ' The error term is heteroskedastic. Z = exp(N[0,1]) equation eq1.ls y=c(1)+(c(2)*x3)^c(1) t2(!i)=(c(2) - 5) / @stderrs(2) ' The null hypothesis is true next smpl 1 !nrep vector tv=@sort(t2 , "a" , " f ") scalar crit10_actual=tv(9000) ' Compute the "actual" finite-sample critical values from the ranked t-statistics show crit10_actual scalar crit05_actual=tv(9500) show crit05_actual scalar crit01_actual=tv(9900) show crit01_actual mtos(tv , ts) ' Convert the VECTOR of saved t-statistics into a SERIES to facilitate plotting, etc. '(can convert either tv or t here) series idum=@obsnum ' Now compute actual "sizes" of the test if asymptotic crit. vals. were wrongly used smpl 1 !nrep if ts> crit01 ' This will give us measures of "size distortion" due to small sample size scalar size01=(@last(idum)-@first(idum)+1)/!nrep show size01 smpl 1 !nrep if ts> crit05 scalar size05=(@last(idum)-@first(idum)+1)/!nrep show size05 smpl 1 !nrep if ts> crit10 scalar size10=(@last(idum)-@first(idum)+1)/!nrep show size10 smpl 1 !nrep show ts hist ts ' Display the results for the complete sampling distribution of our test statistic