全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
9751 10
2010-05-23
悬赏 2 个论坛币 已解决
请问高手们在用sas做非线性回归拟合的时候怎样才能有拟合曲线图?

最佳答案

bobguy 查看完整内容

You may save the fitting value within a precudure, then graph it in poc gplot. Here is an example, title 'U.S. Population Growth'; data uspop; input pop :6.3 @@; retain year 1780; year = year+10; yearsq = year*year; datalines; 3929 5308 7239 9638 12866 17069 23191 31443 39818 50155 62947 75994 91972 105710 122775 131669 151325 179323 203 ...
二维码

扫码加我 拉你入群

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

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

全部回复
2010-5-23 22:09:32
wendyliu919 发表于 2010-5-23 22:09
请问高手们在用sas做非线性回归拟合的时候怎样才能有拟合曲线图?
You may save the fitting value within a precudure, then graph it in poc gplot.

Here is an example,

  title 'U.S. Population Growth';
   data uspop;
      input pop :6.3 @@;
      retain year 1780;
      year   = year+10;
      yearsq = year*year;
      datalines;
   3929 5308 7239 9638 12866 17069 23191 31443 39818 50155
   62947 75994 91972 105710 122775 131669 151325 179323 203211
   226542 248710
   ;


   title 'Beaton/Tukey Biweight Robust Regression using IRLS';
   proc nlin data=uspop nohalve;
      parms b0=20450.43 b1=-22.7806 b2=.0063456;
      model pop=b0+b1*year+b2*year*year;
      resid = pop-model.pop;
      sigma = 2;
      k     = 4.685;
      if abs(resid/sigma)<=k then _weight_=(1-(resid / (sigma*k))**2)**2;
      else _weight_=0;
      output out=c r=rbi p=pop_pred;
   run;

   proc print; run;

   symbol1 i=join v=square color=green ;
   symbol2 i=join v=circle color=red;


   proc gplot data=c;
   plot (pop pop_pred)*year/overlay legend;
   run;
   quit;
二维码

扫码加我 拉你入群

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

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

2010-5-23 22:48:59
不是很清楚啊
二维码

扫码加我 拉你入群

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

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

2010-5-24 08:08:39
谢谢。我也学到了一招
二维码

扫码加我 拉你入群

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

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

2010-5-24 14:36:27
3# bobguy

受教了。。
二维码

扫码加我 拉你入群

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

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

2010-5-25 18:47:34
2# bobguy 非常感谢!
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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