我正在执行proc phreg程序,对许多变量(2000+)使用fast选项。但是,对于某些按变量,我会使用快速方法得到以下错误,然后我想继续到下一个按变量,或者通过不使用快速选项的变量来运行相同的变量(有效)。
ERROR: Domain error.
WARNING: Output 'parameterestimates' was not created. Make sure that the output object name, label,
or path is spelled correctly. Also, verify that the appropriate procedure options are used
to produce the requested output object. For example, verify that the NOPRINT option is not
used.
ERROR: Termination due to Floating Point Exception
我尝试改为使用循环宏而不是by变量,但是我不确定如果%syserr> 0到i + 1怎么告诉宏继续?
分析宏的循环宏
%macro loop(start,stop);
%do iii=&start %to &stop;
%analysis(&iii);
%end;
%mend;
%macro analysis(catnum);
data o_&catnum;
set output_&catnum;
if exposed gt 0 then exposed2=1;
if exposed eq 0 then exposed2=0;
run;
ods output parameterestimates=peexp_&catnum;
proc phreg data=o_&catnum fast;
strata yearentry origin;
class sex ;
effect aspl=spline(agefirsttx / naturalcubic knotmethod=equal(5));
effect tspl=spline(num_tx / naturalcubic knotmethod=list(1,3,5,10,20,50,100,150));
model (entry,exit)*censored(1)= exposed2 sex aspl tspl ;
run;
proc datasets nolist;
delete o_&catnum;
run;
%mend;
哦,NOERRORABEND开启了!
感谢任何想法!