My outcome variable is categorical (4 categories: very low, low, moderate, high), and my predictor variables are categorical. One has 3 categories and is year (year1, year2, year3). Year was not included in the class statement. The second is yes/no. And then it is controlled for other covariates. I ran proc glimmix with an interaction term between the two and the interaction term is significant. I am trying to understand what this interaction means from the estimate output and therefore am trying to look at the interaction plot but what I ran did not work. Any help in interpreting this interaction term (via interaction plots if necessary) would be great. Thank you!
proc sort data=data;
by predictor year;
run;
proc means data=data noprint;
by predictor year;
var outcome;
output out=meaned mean=mmoutcome;
run;
proc plot data=meaned;
plot mmoutcome*predictor=year;
run;
SAS Output predictor Estimate Standard Error DF t Value Pr > |t|
year*predictor 0 0.4159 0.1688 765 2.46 0.0140
year*predictor 1
Doesn't work is awful vague.
Are there errors in the log?: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.
No output? Post any log in a code box.
Unexpected output? Provide input data in the form of a dataset, the actual results and the expected results. Data should be in the form of a data step. Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.
You may also want to consider use of Proc Sgplot as it has many more options that Proc Plot and can combine plots into a single graph within limits.
If you have an image file of the result, if you are generating html output by default the resulting PNG file is likely in your the folder where your Work library resides and you can post the image using the forums menu icon that looks like a camera and says "Photos".
I'm not sure of your question about Vbar and Sgplot. Yes I have used it personally, if that is the question. I have used most of the options in Sgplot or Sgpanel as well as GTL and Sgrender to make some moderately complex plots.
I will say that for interactions I might start with the raw data first and not the results of model to show general relationships. Then the model results might make more sense.
I have attached the graph output as well as the code that I used for the graph and the code I used for the model. Thank you for your help.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.