%macro product(aa=,bb=);
proc sql;
create table c as
select intercept as intercept, x1*y1 as z1 %do i=2 %to 8;,x&i*y&i as z&i %end;
from &aa,&bb;
quit;
%mend;
%macro logistic(data=,dv=,iv=,num=,dnum=,test=);
/* data means what you want do satatistical test on*/
/* dv and iv means dependent variable and independent variables*/
/* dnum is used to specify how many dependant variables includes, like
/*x1 x2 x3...x8, where there are 8 variable and setting dnum=8*/
/* test is dataset, based on which you get predicted yi.*/
data estimates(keep=&dvv1-&dvv2,intercept);
set estimates;
run;
/* keep coefficient for dv and intercept in dataset estimates;*/
%product(aa=estimates,bb=test);
proc sql;
create table y&i as
select z1+z2+z3+z4+z5+z6+z7+z8 as y;
/* where there should be on simplied expression instead of z1+...z8*/
from c;
quit;
%end;
%mend;
Any commets are welcome. thanks a lot!作者: shiyiming 时间: 2006-3-22 19:15 标题: thanks!!! 这几天没有上网,才看到您的回复,非常感谢!作者: shiyiming 时间: 2006-4-20 12:15 标题: to gesas 我是新手,只知道简单的sas语法,你写的程序里面好多我都不懂,比如:macro, call, from, 还有%也不知道什么意思,能不能再详细给我讲一下,或者传给我一些关于macro和哪些%的相关资料,我参考一下,能不能信件交流一下,我的mail:atomdust@163.com,多谢了!作者: shiyiming 时间: 2006-4-22 23:01 标题: to najia_yj 这个你还是要参看一些教程了。看看marco的在线教材也是不错。这个论坛上有在线教材的link。