Sas reg simple
-
Upload
wensheng-chang -
Category
Documents
-
view
198 -
download
0
Transcript of Sas reg simple
REG procedure:Simple linear
regression2013.03.14
Syntax
PROC REG <options> ;MODEL dependents=<regressors> < / options > ;PLOT <yvariable*xvariable> <=symbol> <...yvariable*xvariable> <=symbol> </ options> ;
RUN;
Syntax
PROC REG <options> ;MODEL dependents=<regressors> < / options > ;PLOT <yvariable*xvariable> <=symbol> <...yvariable*xvariable> <=symbol> </ options> ;
RUN;
• y = x• weight = age height
Syntax
PROC REG <options> ;MODEL dependents=<regressors> < / options > ;PLOT <yvariable*xvariable> <=symbol> <...yvariable*xvariable> <=symbol> </ options> ;
RUN;
Variable namesKeywords
Example
data example1;do i=1 to 200;
x=10*rannor(100);y=x+10*rannor(3);output;
end;drop i;;
proc reg; model y=x;run;
Output
Output: Residual diagnosis
Example
data example1;do i=1 to 200;
x=10*rannor(100);y=x+10*rannor(3);output;
end;drop i;;
proc reg CORR; model y=x/CLM CLI CLB;plot residual.*predicted. y*x;run;
Example
data example1;do i=1 to 200;
x=10*rannor(100);y=x+10*rannor(3);output;
end;drop i;;
proc reg CORR; model y=x/CLM CLI CLB;plot residual.*predicted. y*x;run;