I want to get all possible multiplicative interactions i.e, my input variable has 4 categeories. (say A, B, C, D) and then how can i get all possible interactions.
A*B, A*C,... A*B*C, A*B*D,... etc.)
Hi
Below a code example to get what you asked for.
Have also a look at Proc Mixed and the like - may be that's in the end what you're aiming for.
HTH
Patrick
data have;
do CatVar='a','b','c','d','e','b';
output;
end;
run;
proc sql;
create view Vhave as
select Distinct CatVar
from have
order by CatVar;
quit;
proc transpose data=Vhave out=TransHave;
var CatVar;
run;
proc summary data=TransHave;
class col:;
output out=CombHave(where=(_type_ ne 0));
run;
data want;
set CombHave;
CombVar=cats(of col:);
run;
In GLM, you can use the "bar operator" (|) to get all possible interactions. I suspect that syntax would work in MIXED as well. Check the syntax in the MODEL statement.