SAS中文论坛

 找回密码
 立即注册

扫一扫,访问微社区

查看: 1338|回复: 7
打印 上一主题 下一主题

reg中如何把R SQUARE导出到输出数据集中

[复制链接]

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
楼主
 楼主| 发表于 2007-1-12 23:03:26 | 只看该作者

reg中如何把R SQUARE导出到输出数据集中

一个初学者的问题:
我想使用一个回归模型的R方,
请问在PROC REG 中,如何将回归模型的R方进到输出数据集中?因为默认的输出数据集中只包括各回归系数的估计值,而没有R方。
回复 支持 反对

使用道具 举报

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
沙发
 楼主| 发表于 2007-1-16 14:41:58 | 只看该作者

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.
回复 支持 反对

使用道具 举报

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
板凳
 楼主| 发表于 2007-1-16 19:46:14 | 只看该作者

非常感谢

非常感谢您的回复!
reg能提取出很多统计量,但是最常用的R方却无法提取到数据集中,太不可思议了。
回复 支持 反对

使用道具 举报

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
地板
 楼主| 发表于 2007-1-17 12:05:56 | 只看该作者

和阿

试试ODS行不~
回复 支持 反对

使用道具 举报

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
5#
 楼主| 发表于 2007-1-22 08:38:28 | 只看该作者

Re

proc reg data=sashelp.class outest=out edf;
   model weight=height;
run;
quit;
回复 支持 反对

使用道具 举报

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
6#
 楼主| 发表于 2007-4-5 14:44:53 | 只看该作者

re

楼上的牛的,谢谢了
回复 支持 反对

使用道具 举报

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
7#
 楼主| 发表于 2007-4-6 08:42:31 | 只看该作者

re

edf什么意思?
回复 支持 反对

使用道具 举报

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
8#
 楼主| 发表于 2007-4-6 14:47:42 | 只看该作者

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;
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|SAS中文论坛  

GMT+8, 2025-6-12 21:29 , Processed in 0.069334 second(s), 20 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表