标题: 程序出错,请帮忙,急!!!!!!!! [打印本页] 作者: shiyiming 时间: 2012-9-29 13:10 标题: 程序出错,请帮忙,急!!!!!!!! proc iml;
use a;
read all into x;
start parent (x,se);
aa=nrow(x); m=x[+,1];n=aa-m;ma=J(m,2,.);pe=J(n,2,.);t=0;
do j=1 to aa;
t=t+1;
if x[j,1]*j^=j then t=t;
pe[t,]=x[j,];
end;
ma=x[n+1:aa,];
a=1+round((n-1)*ranuni(j(50,1,0)));
b=1+round((m-1)*ranuni(j(50,1,0)));
if se=0 then Pa=ma[a,2];
if se=1 then Pa=pe[b,2];
return (pa);
finish;
p1=pa(x,0);p2=pa(x,1);
print P1 P2;
quit;run;
求助程序出错,原因在于t的行数和pe的行数不一致,请帮忙!
本文来自: 人大经济论坛 SAS专版 版,详细出处参考: <!-- m --><a class="postlink" href="http://bbs.pinggu.org/forum.php?mod=viewthread&tid=1593991&page=1&fromuid=844830">http://bbs.pinggu.org/forum.php?mod=vie ... uid=844830</a><!-- m -->作者: shiyiming 时间: 2012-10-3 00:26 标题: Re: 程序出错,请帮忙,急!!!!!!!! 不懂IML,只是从原始连接处引出想法如下。
你是否想这样:当条件不成立时T不加,否则T+1?
if x[j,1]*j=j then t=t+1;