2013年7月11日 星期四

簡單線性迴歸 (Simple Linear Regression)

簡單線性迴歸 (Simple Linear Regression)
資料如附檔

SAS Codes
LIBNAME lib EXCEL "D:\SasData\jsp.XLSX" ;
data a; set lib."jsp2$"N; run;

/*Simple linear regression*/
proc print; run;
ods graphics on;
 proc reg data=a;
    model math_yr_3 = math_yr_1/spec;
      output out=a1 p=predict r=residual;
 run;
ods graphics off;

proc sgplot data=a;
  reg x=math_yr_1 y=math_yr_3;
run;

proc univariate data=a1 normal plot;
var residual;

run;











沒有留言:

張貼留言