作业帮 > 综合 > 作业

用sas怎么得到不同的岭参数下各自变量的标准回归系数

来源:学生作业帮 编辑:拍题作业网作业帮 分类:综合作业 时间:2024/04/28 14:16:06
用sas怎么得到不同的岭参数下各自变量的标准回归系数

怎么写程序得出来的?
利用SAS软件的reg过程的ridge=选项就很容易实现.具体示例代码如下:
options nodate nonumber;
data simulation;
       input x1-x3 y@@;
      x4=x1*x2;
datalines;
1300 7.5 .012 49 1300 9 .012 50.2 1300 11 .0115 50.5
1300 13 .5.013 48.5 1300 17 .0135 47.5 1300 23 .012 44.5
1200 5.3 .04 28 1200 7.5 .038 31.5 1200 11 .032 34.5
1200 13 .5.026 35 1200 17 .034 38 1200 23 .041 38.5
1100 5.3 .084 15 1100 7.5 .098 17 1100 11 .092 20.5
1100 17 .086 29.5
;
run;
proc reg data=simulation outstb outest=ridge_out(where=(_type_="RIDGE")) ridge=0 to 0.02 by .002;
      model y=x1 x2 x3 x4/noprint;
run;
quit;
proc print data=ridge_out label split="*";
     title "Results of Ridge Regression";
     id _ridge_;
     var intercept x1-x4 y;
     label _ridge_="ridge*parameter";
run;
程序的执行结果如下:

要得到你所给出的那张表,只需要把数据换一下就可以了.