以下是我的SAS程序,我想做主成分回归,就是不出来结果,求SAS大神指导。
数据的输入
date d1;
input group y x1-x8 @@;
cards;
y 98.60 100.40 100.70 99.20 101.20 103.90 101.80 101.50 104.80 105.90 99.30
x1 89677.10 99214.60 109655.20 120332.70 135822.80 159878.30 184937.40 216314.40 265810.30 314045.40 340504.90
x2 119897.30 134610.30 158301.90 185007.00 221222.80 254107.00 298755.70 345603.59 403422.20 475166.60 606225.00
x3 827.83 827.84 827.70 827.70 827.70 827.68 819.17 797.18 760.40 694.51 683.10
x4 29854.70 32917.70 37213.50 43499.90 55566.60 70477.40 88773.60 109998.20 137323.90 172828.40 224589.90
x5 1949.30 2492.00 2661.00 3256.00 4382.30 5933.20 7619.50 9689.40 12177.80 14306.90 12016.10
x6 1546.75 1655.74 2121.65 2864.07 4032.51 6099.32 8188.72 10663.40 15282.49 19460.30 23991.52
x7 93734.30 99371.07 112314.70 131293.93 158996.23 177363.49 194690.39 225285.28 261690.88 303394.64 399684.82
x8 -718.92 -827.90 -1293.95 -2036.37 -3204.81 -5271.64 -7369.55 -9866.22 -14522.09 -18765.79 -23308.42
;
proc print d1;
run;
用回归过程做共线性诊断
proc reg data=d1;
model y=x1-x8/vif collin;
run;
主成分回归
proc reg data=d1 outtest=out1;
model y=x1-x8/ pcom it=1,2outvif;
procprint data=out1;
run;
岭回归
proc reg data=d2 outest=out2 graphics outvif;
model y y=x1-x8、ridge=0.0 to 0.1 by 0.1 0.2 0.3 0.4 0.5;
plot/ridgepolt;
run;
偏最小二乘回归
proc pls data=d2 outmodel=out3 cv=one method=simpls;
model y=x1-x8;
proc print data=out3;
run;