clear
pause on
program drop _all

program define mysim
			  if "`1'"=="?" {
                    global S_1 "max_y x1 min_y x2"
                    exit
            }
            drop _all
          	set obs 500
		gen x = invnorm(uniform()) + 2
		gen y = -.3 + .8*x + invnorm(uniform())
		summarize x
		post `1' (r(max)) (x) (r(min)) (x)
    end

simul mysim, rep(500)