BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
RobertWF1
Quartz | Level 8

Suppose I have a dataset containing 0/1 dummy variables x1, x2, . . . , xk and I'd like to find the mean values (i.e., probabilities) of all possible combinations of the main terms and interactions.

 

We won't assume the variables are independent and therefore can't simply multiply the mean values of main terms to find mean values of interactions

 

I was hoping the following would work but alas it doesn't:

 

proc means data=test;
var x1|x2|x3@3;
run;

 

 

Also tried the lsmeans statement in proc reg or proc glm but it only finds the means of the dependent variable conditional on x1|x2|x3.

 

Is there a handy procedure, statement or option that will do this for me? I'll keep hunting through the SAS documentation.

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

PROC GLMMOD will create an output data set containing all main effects and interactions. Then you can run that output through PROC MEANS.

 

 

--
Paige Miller

View solution in original post

1 REPLY 1
PaigeMiller
Diamond | Level 26

PROC GLMMOD will create an output data set containing all main effects and interactions. Then you can run that output through PROC MEANS.

 

 

--
Paige Miller

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 651 views
  • 1 like
  • 2 in conversation