I have two different data sets, six different outcome variables, and two primary (separate) predictors which I am trying to incorporate into proc logistic along with several covariates using a macro. I'm trying to figure out the most efficient way. My initial thought was:
%macro mod(dat, out, pred);
proc logistic data=&dat;
model &out=&pred cov1 cov2 cov3 cov4 cov5 cov6 /desc;
run;
%mend mod;
%mod (dat1, out1, pred1);
%mod (dat1, out2, pred1);
%mod (dat1, out3, pred1);
%mod (dat1, out4, pred1);
%mod (dat1, out5, pred1);
%mod (dat1, out6, pred1);
%mod (dat1, out1, pred2);
%mod (dat1, out2, pred2);
%mod (dat1, out3, pred2);
%mod (dat1, out4, pred2);
%mod (dat1, out5, pred2);
%mod (dat1, out6, pred2);
%mod (dat2, out1, pred1);
%mod (dat2, out2, pred1);
%mod (dat2, out3, pred1);
%mod (dat2, out4, pred1);
%mod (dat2, out5, pred1);
%mod (dat2, out6, pred1);
%mod (dat2, out1, pred2);
%mod (dat2, out2, pred2);
%mod (dat2, out3, pred2);
%mod (dat2, out4, pred2);
%mod (dat2, out5, pred2);
%mod (dat2, out6, pred2);
Is there a more efficient way, by referring to the outcome variables only once/nesting the macro? Another, however also inefficient, way is:
%macro mod(out);
proc logistic data=data_one;
model &out=pred1 cov1 cov2 cov3 cov4 cov5 cov6/desc;
run;
proc logistic data=data_one;
model &out=pred2 cov1 cov2 cov3 cov4 cov5 cov6/desc;
run;
proc logistic data=data_two;
model &out=pred1 cov1 cov2 cov3 cov4 cov5 cov6/desc;
run;
proc logistic data=data_two;
model &out=pred2 cov1 cov2 cov3 cov4 cov5 cov6/desc;
run;
%mend mod;
%mod (out1);
%mod (out2);
%mod (out2);
%mod (out3);
%mod (out4);
%mod (out5);
%mod (out6);
Thanks in advance!
Em