nulldata 50
genr x = 100 * uniform()
# open a "progressive" loop, to be repeated N times
loop 100 --progressive
genr u = 10 * normal()
# construct the dependent variable
genr y = 10*x + u
# run OLS regression
ols y const x
# grab the estimated slope coefficient
genr b = $coeff(x)
genr r2 = $rsq
# arrange for printing of stats
print b
# and save to file
store coeff.gdt b
endloop
# now one can open coeff.gdt and examine the distribution