BookmarkSubscribeRSS Feed
Calcite | Level 5

I am using the LSMEANS statement to request specific odds ratios in PROC GLIMMIX.  I have an interaction term (binary by binary interaction) that I am requesting odds ratios for but would like to see the odds ratios at each level of another binary covariate.  

a; binary 0,1

b; binary 0,1

c; binary 0,1

a*b interaction between a and b


lsmeans a*b / ilink oddsratio cl diff;

gives me beautiful output but once I try using the 'at' option to specify the value of another covariate SAS gives me a warning:

lsmeans a*b / at c =1 ilink oddsratio cl diff;

WARNING: Incorrect AT specification in LSMEANS statement. c is not a covariate in the model. The statement is


I already know that this is because variable c is in the class statement and only continuous variables can be used in the 'at' option.  


Does anyone know how to create odds ratios for an interaction at a certain level of a binary variable?



Obsidian | Level 7

I’m not 100% sure, but you might be able to change the combination of ref= statements in the class statement.

Class iv1(ref=‘0’) iv2(ref=‘1’);

I would assume the two reference categories would end up as the reference combination for the interaction.


A similar option might be to actually create your interaction variable and define the reference group.


Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.


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