问题描述
我正在测试Student版本的SAS REG程序。我设置了下表:
data work.house;
input houseSize lotSize bedrooms granite bathroom sellingPrice;
cards;
3529 9191 6 0 0 205000
3247 10061 5 1 1 224900
4032 10150 5 0 1 197900
2397 14156 4 1 0 189900
2200 9600 4 0 1 195000
3536 19994 6 1 1 325000
2983 9365 5 0 1 230000
;
run;
然后我对各种变量进行了回归分析,如下所示:
proc reg data=work.HOUSE;
model sellingPrice = houseSize lotSize bedrooms granite bathroom;
run;
SAS Student以组织良好且完整的视觉形式(包括许多图形)显示结果。
但是,我需要使用估计的参数来预测其他输入。
有什么方法可以访问这些参数?
或者是否可以将结果(特别是 Parameter Estimates 表)保存到SAS数据集中?
解决方法
使用过程选项OUTEST=
保存参数估计值。
使用OUTPUT
语句保存带有预测值和残差值的原始数据。
示例:
* output data sets highlighted with ^^^^;
proc reg noprint data=work.HOUSE outest=parameters;
* ^^^^^^^^^^ ;
model sellingPrice = houseSize lotSize bedrooms granite bathroom;
output out=predicted p=fitprice r=fitresidual;
* ^^^^^^^^^;
run;
quit;
参数
预测