/* Goal: to simulate 4000 simple linear regressions and study the joint limiting distributions of a, b, MSE. */ * -------------------; Options notes; /*proc datasets; ; delete allbetas run; ; ---------------------*/ %let a=10; %let b=2; %let sig=3; Data a; input X @@; do rep= 1 to 4000; Y = &A + &B*X + &sig*normal(1827689); file print; if rep<3 then put Y= X= ; output; end; cards; 14 9 20 25 13 8 12 10 10 5 30 26 18 11 19 22 25 19 8 15 proc sort data=a; by rep; proc print data=a; where rep=1; title "Data generated as Y = &a + &b.X + &sig e "; ** try removing the dot **; %macro slow; %do rep = 1 %to 100; proc reg noprint data=a outest=betas; model Y = X; where rep = &rep; proc append base=allbetas data=betas; %end; %mend slow; proc datasets; delete allbetas; %slow; proc print data=allbetas(obs=40); run;