Hello,
My colleague has performed an APIM analysis in proc mixed, and obtained a significant three-way interaction. The outcome variable is continuous (satisfaction). Two predictors are continuous (perceptions and drinking) and one predictor is dichotomous (gender).
I would like to graph this 3-way interaction (perception*drinking*gender). Preferrably, I would like two windows, one displaying the 2-way interaction (perceptions and drinking) for males and one window for females.
Do anyone have any tips to help me graph this interaction?
Thank you!
proc gplot;
by gender; *for 2 graphs;
plot perception*drinking;
run;
plot perception*drinking=gender; *both on one graph;
run;
Hi Bill,
Thanks so much. However, those plots do not model the outcome variable (satisfaction). They just give a scatterplot of the data of two variables (by the third variable, gender). The interaction plot should give us two lines that intercept each other. The plots outputted by the code would only give us one line (the relationship between perception and drinking).
Could you post a number of records for me to play with?
Maybe you need this:
symbol i=j v=none r=200;
proc gplot;
by gender;
plot perception*drinking=idno;
run;
idno is number of patient.
r= is repeat 200 times which is 200 patients.
i.e. How many patients you have ,how many repeated times(200)
Ksharp
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.