BookmarkSubscribeRSS Feed
jgreenberg321
Fluorite | Level 6

Hello,

 

I am interested in plotting the predicted probabilities from an interaction I've created using proc genmod. I would like to have the x-axis be a categorical variable by year, so the probabilities are displayed as strait lines between years. I set year as a categorical variable in my model with 2011 (earliest year) as the reference. However, when I create the effect plot, the years are displaying out of order. Does anyone know if there is an easy way to set the ordering/levels of the categorical variable on the x-axis. For reference, example code is below. Thank you!

 

proc plm source=genmod;

effectplot interaction (x=year sliceby=group ) ;

run;

1 REPLY 1
StatDave
SAS Super FREQ

Try explicitly setting the order for the YEAR variable in your CLASS statement so that its levels are ordered by its internal levels. For example:

proc genmod;
class group year(order=internal);
model y=group year;
effectplot interaction(x=year sliceby=group);
run;

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 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1 reply
  • 506 views
  • 1 like
  • 2 in conversation