Hello everyone! I'm having a problem I hope some of you may be able to help with. We are doing a project in which we wish to do variable selection for an MLE statistical model using PROC GENMOD. We wished to make our variable selection by running every combination of variables against GENMOD and retrieving our determining statistic. To accomplish this I wanted to create a table in which one of the columns is the concatenation of variable combinations that I would then use to run a table based loop. Using ALLCOMB I was able to borrow/modify code that creates the table I need (see code below). However, we will have more than 33 variables and I have not been able to replicate my results using ALLCOMBI. Can someone offer suggestions on how to modify my code to use ALLCOMBI? Thanks very much in advance for any help you may be able to provide! (BTW, I am also open to suggestions on running the GENMOD directly off the ALLCOMBI instead of using the table loop if that's possible, but I didn't see how that could be done.) data have;
input prog $ mesr $ x1 $ x2 $ x3 $ x4 $ x5 $;
datalines;
adt q2r v001 v002 v003 v004 v005
; run;
data want;
set have;
array _a x1--x5;
do i = 2 to 4;
do j = 1 to comb(dim(_a), i);
call allcomb(j, i, of _a{*});
length comb $500;
call missing (comb);
do k = 1 to i;
if missing(_a{k}) then leave;
comb = catx(" ", comb, _a{k});
cnt1 = i;
cnt2 = j;
end;
if k > i then output;
end;
end;
keep cnt1 cnt2 prog mesr comb;
run;
... View more