楼主: ziyenano
5580 12

[原创博文] proc gam预测的问题求教 [推广有奖]

  • 0关注
  • 52粉丝

院士

7%

还不是VIP/贵宾

-

威望
2
论坛币
6137 个
通用积分
27.3565
学术水平
338 点
热心指数
326 点
信用等级
298 点
经验
57352 点
帖子
879
精华
1
在线时间
4132 小时
注册时间
2012-1-4
最后登录
2025-5-7

楼主
ziyenano 发表于 2012-7-25 23:14:15 |AI写论文
2论坛币
SAS 中proc gam做非参数回归,能不能实现预测
data ex;                                                                                                                             
input x y;                                                                                                                          
cards;                                                                                                                                 
33.35 1854                                                                                                                              
34.78 1857                                                                                                                              
36.22 1948                                                                                                                             
37.66 2017                                                                                                                             
39.09 2092                                                                                                                             
40.53 2197                                                                                                                             
41.76 2608                                                                                                                             
42.81  2973                                                                                                                           
43.9   3119                                                                                                                           
44.9  3654
51.0  .  
;
run;
proc gam data=ex;
model y=spline(x)/dist=gaussian;
output out=predict pred=yp;
run;
如上,我想预测x=51.0的时候,y的值,请教各位高手,SAS中如何实现?
另外我想问一下:
局部多项式回归,窗宽(bandwidth)这个值,除了使用菜单中交互式数据分析,能否有过程步能够求解窗宽?

最佳答案

hcydlee 查看完整内容

我知道是什么原因了。因为你要预测的X值是51,超过了training dataset 的范围,所以proc gam无法计算其预测值。具体可以参考 http://support.sas.com/kb/14/043.html If the value of a predictor variable in the SCORE DATA= data set is outside the range of that predictor variable in the PROC GAM DATA= dataset, then predicted values for that variable and for the response will be missing in the SCORE OUT= dat ...
关键词:问题求教 GAM ROC bandwidth Gaussian

本帖被以下文库推荐

沙发
hcydlee 发表于 2012-7-25 23:14:16
我知道是什么原因了。因为你要预测的X值是51,超过了training dataset 的范围,所以proc gam无法计算其预测值。具体可以参考 http://support.sas.com/kb/14/043.html

If the value of a predictor variable in the SCORE DATA= data set is outside the range of that predictor variable in the PROC GAM DATA= dataset, then predicted values for that variable and for the response will be missing in the SCORE OUT= data set.  Predicted values can only becomputed when all predictor values are in the range the data used to fitthe model.
80 字节以内
不支持自定义 Discuz! 代码

藤椅
ziyenano 发表于 2012-7-26 09:14:47
自己顶一个!

板凳
jingju11 发表于 2012-7-26 11:56:36
score statement should work on your purpose. jingju

报纸
ziyenano 发表于 2012-7-26 12:56:05
jingju11 发表于 2012-7-26 11:56
score statement should work on your purpose. jingju
谢谢京剧,但是我试过score语句,和output一样,没法预测

地板
hcydlee 发表于 2012-7-26 16:26:35
SCORE DATA=SAS-data-set OUT=SAS-data-set ;
80 字节以内
不支持自定义 Discuz! 代码

7
ziyenano 发表于 2012-7-26 16:44:24
hcydlee 发表于 2012-7-26 16:26
SCORE DATA=SAS-data-set OUT=SAS-data-set ;
没法预测,y还是缺失值

8
hcydlee 发表于 2012-7-26 17:07:05
ziyenano 发表于 2012-7-26 16:44
没法预测,y还是缺失值
看你的程序,predicted value should be stored in the variable: yp_y.
80 字节以内
不支持自定义 Discuz! 代码

9
ziyenano 发表于 2012-7-26 17:33:11
hcydlee 发表于 2012-7-26 17:07
看你的程序,predicted value should be stored in the variable: yp_y.
A@~MWW3RNPL5RZH03IG)X`C.jpg

你运行一下吧,如果能有预测结果,麻烦告诉我一下,谢了!

10
ziyenano 发表于 2012-7-26 20:22:53
hcydlee 发表于 2012-7-26 20:04
我知道是什么原因了。因为你要预测的X值是51,超过了training dataset 的范围,所以proc gam无法计算其预测 ...
额,我想要的效果是向前预测,不过还是非常的感谢你!

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-29 03:26