Hi! I have a problem with my sas code. I use an ods output instruction in a macro variable, and if I run the three proc inside the macro, I have no problems, but when I try to run the macro itself, I always get the same note and nothing works. I've tried any kind of "ods output close/clear" etc, but nothing seems to work and the note always shows up while running the macro. I'm new to programming here, maybe the code itself is wrong, but I can't understand while it doesn't work inside the macro but it works for itself. Thanks! My code: %macro ZINB; proc countreg data=tot; where v1; model v1=t1 t2 t3/dist=zinb; *offset=ltotal; zeromodel v1 ~ t1 t2 t3/link=logistic; ods output ParameterEstimates=pe; run; proc sql; select estimate as b0 into: b0 from pe where Parameter= 'Intercept'; select estimate as b1 into: b1 from pe where Parameter= 't1'; select estimate as b2 into: b2 from pe where Parameter= 't2'; select estimate as b3 into: b3 from pe where Parameter= 't3'; select estimate as c0 into: c0 from pe where Parameter= 'Inf_Intercept'; select estimate as c1 into: c1 from pe where Parameter= 'Inf_t1'; select estimate as c2 into: c2 from pe where Parameter= 'Inf_t2'; select estimate as c3 into: c3 from pe where Parameter= 'Inf_t3'; select estimate as k into: k from pe where Parameter= '_Alpha'; quit; /* independent random effects */ proc nlmixed data=tot tech=newrap; where v1; parms b0=&b0. b1=&b1. b2=&b2. b3=&b3. c0=&c0. c1=&c1. c2=&c2. c3=&c3. k=&k. su=1 sv=1; eta = b0 + b1*t1 + b2*t2 + b3*t3 + ltotal + ui; lambda = exp(eta); eta_p = c0 + c1*t1 + c2*t1 + c3*t3 + vi; p0 = 1/(1+exp(-eta_p)); /* define ZINB log likelihood */ if v1=0 then ll = log( p0 + (1-p0)/(1+k*lambda)**(1/k) ); else ll = log((1-p0)) + v1*log(k*lambda) - (v1+(1/k))*log(1+k*lambda) + lgamma(v1+(1/k))- lgamma(1/k) - lgamma(v1+1); model v1 ~ general(ll); random ui vi ~ normal ([0,0], [su*su, 0, sv*sv]) subject=n_geni_ul_mdn; run; %mend; %macro driver (); %do vi=10001 %to 10149; %ZINB; %end; %mend;
... View more