BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi all,

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.)


Thanks.
3 REPLIES 3
Cynthia_sas
SAS Super FREQ
Hi:
If you are talking about PROC MEANS and CLASS variables, look at the doc for the TYPES and WAYS statements:
http://support.sas.com/documentation/cdl/en/proc/59565/HTML/default/a000146737.htm

cynthia
Patrick
Opal | Level 21
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;

proc print data=want;
run;
Doc_Duke
Rhodochrosite | Level 12
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.

Doc Muhlbaier
Duke

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1142 views
  • 0 likes
  • 4 in conversation