求sas岭回归的代码
分类:SAS
多元回归分析中,共线性比较严重,请教下有没有岭回归的代码?谢谢。
1个回复
-
xsmile
from http://blog.sina.com.cn/s/blog_9e2be81101018uzv.html
data d452;
input x1-x3 y;
cards;
149.3 4.2 108.1 15.9
161.2 4.1 114.8 16.4
171.5 3.1 123.2 19.0
175.5 3.1 126.9 19.1
180.8 1.1 132.1 18.8
190.7 2.2 137.7 20.4
202.1 2.1 146.0 22.7
212.4 5.6 154.1 26.5
226.1 5.0 162.3 28.1
231.9 5.1 164.3 27.6
239.0 0.7 167.6 26.3
;
run;proc reg data=d452;
model y=x1-x3 / vif collin;
run;proc reg data=d452 outest=o452 graphics;
model y=x1-x3 / ridge=0.0 to 1.0 by 0.1;
plot / ridgeplot;
run;
proc print data=o452;
run;4年前 我来评论