Here is the code I am working with so far: proc genmod data=xxx descending; class exposure pharmid studyarm (ref='0') / param=ref; model outcome = exposure studyarm / dist=bin link=logit type3 wald; repeated subject = pharmid / type=cs; run; I would like to create a macro that will regress each of 10 outcome variables on each of 10 exposure variables using this code. As I mentioned above, I was able to write a macro that would regress each outcome on a given group of exposure variables, but I haven't figured out how to loop the macro through all of the exposure variables individually. Here is what I have so far: %macro preliminary_gee(all_deps, indvars =); %let k=1; %let dep = %scan(&all_deps, &k); %do %while(&dep NE); proc genmod data=xxx descending; class &indvars pharmid studyarm; model &dep = &indvars studyarm / dist=bin link=logit type3 wald; repeated subject = pharmid / type=cs; run; %let k = %eval(&k + 1); %let dep = %scan(&all_deps, &k); %end; %mend preliminary_gee; In addition, it would be great to suppress the output and to just create a dataset containing the OR estimates from each regression. Again, any ideas you have would be much appreciated. Thanks!
... View more