SAS中文论坛

标题: reg中如何把R SQUARE导出到输出数据集中 [打印本页]

作者: shiyiming    时间: 2007-1-12 23:03
标题: reg中如何把R SQUARE导出到输出数据集中
一个初学者的问题:
我想使用一个回归模型的R方,
请问在PROC REG 中,如何将回归模型的R方进到输出数据集中?因为默认的输出数据集中只包括各回归系数的估计值,而没有R方。
作者: shiyiming    时间: 2007-1-16 14:41
标题: To: hh888999
I am not able to give you a quick answer, but generally there are three ways to deal with this kind of problem.

1. Try another PROC.  For example, sometimes PROC GLM can be used for linear regression analysis, and you can see if you can save R-Square from PROC GLM;

2. In many cases, the statistics not in output data set can be derived from the other statistics in the data set.  For example, the variance of residual can be saved, and R-Square can be derived from these statistics.

3. Another way to get estimates not saved in the output data set is piping output window to a file, and read that file back using INFILE.  Start from version 8, SAS uses ODS, it make things easier.  Basically, it saves the stuff in output window into intermediate objects, you candigest from that objects.  You need to check SAS documentation to findout how to do it, I can not explain into detail.

Good Luck.
作者: shiyiming    时间: 2007-1-16 19:46
标题: 非常感谢
非常感谢您的回复!
reg能提取出很多统计量,但是最常用的R方却无法提取到数据集中,太不可思议了。
作者: shiyiming    时间: 2007-1-17 12:05
标题: 和阿
试试ODS行不~
作者: shiyiming    时间: 2007-1-22 08:38
标题: Re
proc reg data=sashelp.class outest=out edf;
   model weight=height;
run;
quit;
作者: shiyiming    时间: 2007-4-5 14:44
标题: re
楼上的牛的,谢谢了
作者: shiyiming    时间: 2007-4-6 08:42
标题: re
edf什么意思?
作者: shiyiming    时间: 2007-4-6 14:47
标题: aa
厉害的~~edf:outputs the number of regressors, the error degrees of freedom, and the model R2 to the OUTEST= data set
用ODS 也可以的ods output FitStatistics=out;




欢迎光临 SAS中文论坛 (http://mysas.net/forum/) Powered by Discuz! X3.2