【问题标题】:How to use the results of a PROC REG in SAS Student如何在 SAS 学生中使用 PROC REG 的结果
【发布时间】:2020-10-01 01:32:50
【问题描述】:

我正在学生版中测试 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 数据集中?

【问题讨论】:

  • 一般看一下OUTPUT语句,看看可以保存什么类型的数据。但是看到的任何输出都可以保存到数据集,包括图表后面的数据,blogs.sas.com/content/iml/2017/01/09/…

标签: sas regression linear-regression


【解决方案1】:

使用过程选项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;

参数

预测

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-01-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-09
    • 1970-01-01
    • 2015-03-15
    • 1970-01-01
    相关资源
    最近更新 更多