楼主: wendyliu919
9820 10

[原创博文] 怎样用sas做非线性回归 [推广有奖]

  • 0关注
  • 0粉丝

初中生

61%

还不是VIP/贵宾

-

威望
0
论坛币
22 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
226 点
帖子
14
精华
0
在线时间
17 小时
注册时间
2010-3-19
最后登录
2014-1-16

楼主
wendyliu919 发表于 2010-5-23 22:09:31 |AI写论文
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 ...
关键词:非线性回归 线性回归 非线性 拟合曲线 曲线图 曲线图

本帖被以下文库推荐

沙发
bobguy 发表于 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;
已有 1 人评分学术水平 热心指数 收起 理由
crackman + 1 + 1 精彩帖子

总评分: 学术水平 + 1  热心指数 + 1   查看全部评分

藤椅
酆都浪子 发表于 2010-5-23 22:48:59
不是很清楚啊

板凳
tmdxyz 发表于 2010-5-24 08:08:39
谢谢。我也学到了一招

报纸
zhentao 发表于 2010-5-24 14:36:27
3# bobguy

受教了。。

地板
wendyliu919 发表于 2010-5-25 18:47:34
2# bobguy 非常感谢!

7
crackman 发表于 2010-5-25 20:17:26
非常不错的例子

8
xbmy 发表于 2010-8-8 10:31:35
学习了,不错的例子!

9
alexbow 发表于 2010-8-9 12:38:51
不错的例子!

10
.ヽ木˙木℡ 发表于 2013-11-4 11:11:11
bobguy 发表于 2010-5-23 22:09
You may save the fitting value within a precudure, then graph it in poc gplot.

Here is an exa ...
如果是多个变量,比如非线性方程,如何做?

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

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