全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1455 5
2009-12-31
已解决,谢谢。
二维码

扫码加我 拉你入群

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

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

全部回复
2009-12-31 15:53:56
proc reg
restrict语句可以解决
二维码

扫码加我 拉你入群

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

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

2010-1-1 00:04:00
1# Fiona_D

I am not sure how to make the BOUNDS conditions work in proc reg. But proc model handles both bounds + restrictions. Here is an example.

HTH

data t1;
  do i = 1 to 500;
     x1=rannor(123);x2=rannor(123);x3=rannor(123);
     y=-1+0.5*x1+0.2*x2 + 0.3*x3 +rannor(123);
     output;
end;
run;

proc model data=t1;
    y= int + a1*x1+ a2* x2 + a3*x3;
   bounds a1>=0, a2>=0.2, a3>=0;
   restrict a1+a2+a3=1;
   fit y;
run;
quit;
二维码

扫码加我 拉你入群

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

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

2010-1-1 17:28:03
it is right, proc reg can not resolve this problem,
but I do not know whether the last  statement "quit;" is necessary?
二维码

扫码加我 拉你入群

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

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

2010-1-2 01:12:54
4# wfchen

In SAS, the executing time of most procedures or a data step is defined by a step boundary. So the definition of proper boundary sometimes is very important. It can be a very big topic.

Bottomline write your program as clear/standard/simple as possible. It will be easy to debug/maintain/understand.

for example,

data a;
...;
run;

the key word data starts a STEP and run close a step.

proc logistic;
....;
run;

the key word proc logistic starts a STEP and run close a step.


But some procedures are interactive  -- in which your statements may be submitted interactively within the procedures. Most of such procedures need quit as a boundary statement.

for example,

proc sql;
proc reg;
proc iml;
...

HTH
二维码

扫码加我 拉你入群

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

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

2010-1-5 16:40:11
多谢各位高人!{:2_31:}
二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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