Skip to content

Instantly share code, notes, and snippets.

@MJacobs1985
Created September 29, 2021 18:24
Show Gist options
  • Save MJacobs1985/847eacb910557dc22c03d2e02d9d0d48 to your computer and use it in GitHub Desktop.
Save MJacobs1985/847eacb910557dc22c03d2e02d9d0d48 to your computer and use it in GitHub Desktop.
Simulations in SAS
data Rsquared;
do i=1 to 1000 by 1;
x=rand("Normal");
y=1-2*x + 1*x*x + rand("Normal");
output;
end;
proc sgplot data=Rsquared;
scatter x=x y=y;
run;
proc reg data=Rsquared plots=fitplot;
model y=x;
run;
data Rsquared;
do i=1 to 1000 by 1;
x=rand("Normal");
y=1-2*x + 0.5*x*x + rand("Normal");
output;
end;
proc sgplot data=Rsquared;
scatter x=x y=y;
run;
proc reg data=Rsquared plots=fitplot;
model y=x;
run;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment