Sas reg simple

9
REG procedure: Simple linear regression 2013.03.14

Transcript of Sas reg simple

Page 1: Sas reg simple

REG procedure:Simple linear

regression2013.03.14

Page 2: Sas reg simple

Syntax

PROC REG <options> ;MODEL dependents=<regressors> < / options > ;PLOT <yvariable*xvariable> <=symbol> <...yvariable*xvariable> <=symbol> </ options> ;

RUN;

Page 3: Sas reg simple

Syntax

PROC REG <options> ;MODEL dependents=<regressors> < / options > ;PLOT <yvariable*xvariable> <=symbol> <...yvariable*xvariable> <=symbol> </ options> ;

RUN;

• y = x• weight = age height

Page 4: Sas reg simple

Syntax

PROC REG <options> ;MODEL dependents=<regressors> < / options > ;PLOT <yvariable*xvariable> <=symbol> <...yvariable*xvariable> <=symbol> </ options> ;

RUN;

Variable namesKeywords

Page 5: Sas reg simple

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;

Page 6: Sas reg simple

Output

Page 7: Sas reg simple

Output: Residual diagnosis

Page 8: Sas reg simple

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;

Page 9: Sas reg simple

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;