楼主: Fiona_D
1511 5

[原创博文] 已解决,谢谢。 [推广有奖]

  • 0关注
  • 0粉丝

初中生

已卖:1份资源

小学生

92%

还不是VIP/贵宾

-

威望
0
论坛币
38 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
2665 点
帖子
23
精华
0
在线时间
79 小时
注册时间
2009-5-21
最后登录
2011-5-3

楼主
Fiona_D 发表于 2009-12-31 15:52:11 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
已解决,谢谢。
二维码

扫码加我 拉你入群

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

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

关键词:已解决

沙发
爱萌 发表于 2009-12-31 15:53:56
proc reg
restrict语句可以解决
最恨对我说谎或欺骗我的人

藤椅
bobguy 发表于 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;

板凳
wfchen 发表于 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?
so good

报纸
bobguy 发表于 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

地板
Fiona_D 发表于 2010-1-5 16:40:11
多谢各位高人!{:2_31:}

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-16 03:21