REG procedure:
Simple linear regression
         2013.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 names
Keywords
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;

Sas reg simple

  • 1.
    REG procedure: Simple linearregression 2013.03.14
  • 2.
    Syntax PROC REG <options>; MODEL dependents=<regressors> < / options > ; PLOT <yvariable*xvariable> <=symbol> <...yvariable*xvariable> <=symbol> </ options> ; RUN;
  • 3.
    Syntax PROC REG <options>; MODEL dependents=<regressors> < / options > ; PLOT <yvariable*xvariable> <=symbol> <...yvariable*xvariable> <=symbol> </ options> ; RUN; • y=x • weight = age height
  • 4.
    Syntax PROC REG <options>; MODEL dependents=<regressors> < / options > ; PLOT <yvariable*xvariable> <=symbol> <...yvariable*xvariable> <=symbol> </ options> ; RUN; Variable names Keywords
  • 5.
    Example data example1; do i=1to 200; x=10*rannor(100); y=x+10*rannor(3); output; end; drop i; ; proc reg; model y=x; run;
  • 6.
  • 7.
  • 8.
    Example data example1; do i=1to 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;
  • 9.
    Example data example1; do i=1to 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;