全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
5506 12
2012-07-25
悬赏 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 ...
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
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.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-7-26 09:14:47
自己顶一个!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-7-26 11:56:36
score statement should work on your purpose. jingju
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

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

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-7-26 16:26:35
SCORE DATA=SAS-data-set OUT=SAS-data-set ;
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群