BookmarkSubscribeRSS Feed
lboyd
Calcite | Level 5

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

5 REPLIES 5
ballardw
Super User

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.

lboyd
Calcite | Level 5
There were no errors in the log. I'm unsure how to send you the graph so I will describe it to you. Also, the link you sent me no longer exists. The graph had year on the x-axis and outcome on the y axis. At the top it said symbol is value of predictor. There was a 1 (symbol) at 3.11 for Year1, 1 (symbol) at 3.1 for Year2, and 1 (symbol) at 3.01 for Year3. There was a 0 (symbol) at 2.8 for Year1, at 2.61 for Year2, and 2.56 at Year3.

Do you use vbar with proc sgplot?
ballardw
Super User

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.

lboyd
Calcite | Level 5

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.

lboyd
Calcite | Level 5
Also, can you tell from the output of proc glimmix I posted what is going on with the interaction term or do you have to have an interaction to determine what it means?

SAS Innovate 2025: Register Now

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!

What is ANOVA?

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.

Discussion stats
  • 5 replies
  • 3024 views
  • 0 likes
  • 2 in conversation