Hi all, I have been trying to find a way to create all possbile interactions for a procedure. The problem is, for example a*b interaction is same as b*a and I couldn't find a reasonable way to exclude these duplicates. Here is how I started:
data data;
input var $ @@;
cards;
a b c d e f g h i j k
;
run;
data temp;
set data;
run;
proc sql noprint;
select strip(d.var)||"*"||strip(t.var) into :interactions separated by " "
from data as d, temp as t;
quit;
%put &interactions;
And here is the result:
%put &interactions;
a*a a*b a*c a*d a*e a*f a*g a*h a*i a*j a*k b*a b*b b*c b*d b*e b*f b*g b*h b*i b*j b*k c*a c*b
c*c c*d c*e c*f c*g c*h c*i c*j c*k d*a d*b d*c d*d d*e d*f d*g d*h d*i d*j d*k e*a e*b e*c e*d
e*e e*f e*g e*h e*i e*j e*k f*a f*b f*c f*d f*e f*f f*g f*h f*i f*j f*k g*a g*b g*c g*d g*e g*f
g*g g*h g*i g*j g*k h*a h*b h*c h*d h*e h*f h*g h*h h*i h*j h*k i*a i*b i*c i*d i*e i*f i*g i*h
i*i i*j i*k j*a j*b j*c j*d j*e j*f j*g j*h j*i j*j j*k k*a k*b k*c k*d k*e k*f k*g k*h k*i k*j
k*k
Please help!
... View more