Thanks for this suggestion! I have tried the | for all pairwise interactions, but this doesn't let me use the INCLUDE option in the regression in the correct format. I currently have a macro working for what I need like this: %MACRO testint6(data=, x1=, x2=, x3=, x4=, x5=, x6=, x7=, x8=, x9=, x10=, x11=, x12=, x13=, x14=, x15=, x16=, x17=, nummainefx=, outcome=, penter=, pkeep=);
*4;
proc logistic data=&data DESCENDING;
class
&x2 &x3 &x4 &x5 &x6 &x7 &x8 &x9 &x10 &x11 &x12
/ PARAM=REF;
model &outcome(event='1') = &x1 &x2 &x3 &x4 &x5 &x6 &x7 &x8 &x9 &x10 &x11 &x12 &x13 &x14 &x15 &x16 &x17
&x1*&x4
/include=&nummainefx selection=stepwise slentry=&penter slstay=&pkeep
details
lackfit;
run;
*5;
proc logistic data=&data DESCENDING;
class
&x2 &x3 &x4 &x5 &x6 &x7 &x8 &x9 &x10 &x11 &x12
/ PARAM=REF;
model &outcome(event='1') = &x1 &x2 &x3 &x4 &x5 &x6 &x7 &x8 &x9 &x10 &x11 &x12 &x13 &x14 &x15 &x16 &x17
&x1*&x5
/include=&nummainefx selection=stepwise slentry=&penter slstay=&pkeep
details
lackfit;
run;
...
*67;
proc logistic data=&data DESCENDING;
class
&x2 &x3 &x4 &x5 &x6 &x7 &x8 &x9 &x10 &x11 &x12
/ PARAM=REF;
model &outcome(event='1') = &x1 &x2 &x3 &x4 &x5 &x6 &x7 &x8 &x9 &x10 &x11 &x12 &x13 &x14 &x15 &x16 &x17
&x11*&x12
/include=&nummainefx selection=stepwise slentry=&penter slstay=&pkeep
details
lackfit;
run;
%mend testint6;
%testint6(data=wnhest, x1=momage, x2=nomarnopn, x3=nomarpn, x4=marnopn, x5=momedu1, x6=momedu3, x7=momedu4,
x8=momedu5, x9=bmi_un, x10=bmi_ov, x11=bmi_ob, x12=moborn, x13=momage*momage, x14=nomarpn*momedu1, x15=momage*nomarnopn,
x16=momage*nomarpn, x17=momage*momedu4, nummainefx=17, outcome=msdp, penter=.35, pkeep=.95);
I always need the x1-x12 variables included, and then one model at a time test one interaction between x1-x12 vars. The existing macro requires a lot of copy/pasting to change the MODEL line every time an interaction is retained. I will look into feeding in the x1-x12 as a list instead of specifying in the macro every time.
... View more