Well, that makes things interesting (I was wondering how you would evaluate >600 models). OK, Reeza is correct - if you can transpose the data then you'll end up with one output data set (I think you want the OUTEST= option), that gives the estimates for those IV's selected. If you'd rather keep your data in its original form, you could run the models as programmed earlier, getting an output data set for each model, and concatenating them one-at-a-time. Until you end up with one large data set with estimates for all 600+ models. One approach: put PROC APPEND in the macro, while using the OUTEST= option: %macro mylogit (dependent); title "dependent variable is &dependent"; proc logistic data=test desc outest=ABC; model &dependent=var1 var2 var3 var4/selection=forward; run; PROC APPEND BASE=work.ALL data=work.ABC FORCE; run; %mend; I'm a little worried about doing it this way because PROC APPEND will drop variables if they don't appear in the BASE table, but in the DATA table. And it might be that the OUTEST data set will change from one model to another, depending on how many (if any) IVs are significant. Give it a try, using a few runs (ie &start=1, &stop=10 and see what happens). OR... let's just make individual OUTEST data sets, and concatenate them outside the loop. %macro mylogit (dependent); title "dependent variable is &dependent"; proc logistic data=test desc outest=&dependent; *One output data set for each model, each named RULEnnnnn ; model &dependent=var1 var2 var3 var4/selection=forward; run; %mend; So after the above loop runs, you'll have &stop-&start+1 OUTEST data sets, named 'RULEnnnnn'. You don't want to do this: data all; set RULE000123 RULE1122 RULE.....; run; Instead make a macro list of the OUTEST data sets you just created: proc sql; select distinct name into :VARS separated by ' ' from work.var_names(where=(&start <= counter <= &stop)); quit; %put &vars=; /* the above code is using the COUNTER+1; logic mentioned earlier */ data all; set &vars; *or set ALL &vars ; if already have created data set ALL ; run; If you decide to try it this way, I'd advise starting slowly, with say 10 models. Look over the output, check it against all the OUTEST datasets, and then data ALL. If it looks OK, try again for another 20 or so models. NOTE: this is assuming it's the OUTEST= option you want. If not, find the one you need; the logic should hold for whatever OUT= you use. NOTE: you'll end up with 600+ OUTEST tables, so you should probably stop every so often and delete a bunch of them.
... View more