BookmarkSubscribeRSS Feed
Obsidian | Level 7



I'm new to modelling, and I have created the following model aimed to evaluate the factors that contribute to whether a patient receives a specific medication. Relevant covariates include the patient's age, sex, comorbidities (CS1, CS2, CS3), surgery (10 types), surgical urgency (elective vs other), and site the surgery was performed at. 


I've created the following model, which has 4 clinically relevant and highly statistically significant interactions. 


proc logistic data=TXACharlson;
class sex(ref='M') admitCategory(ref='Elective') Surgery_name(ref="Open Hip arthroplasty") site(ref='Ottawa') / param=ref;
model TXAstatus (event='1') = age age*age sex CS1 CS2 CS3 admitCategory Surgery_name site
Surgery_name*admitCategory Surgery_name*age admitCategory*age surgery_name*site / clparm=both clodds=pl rl lackfit;

oddsratio surgery_type / at (age=65);

oddsratio surgery_type / at (age=70);

oddsratio surgery_type / at (age=75);


In order to more easily interpret these interactions, I was hoping to output odds ratios for each interaction, if possible. When I try to use an 'oddsratio' statement (ie)


oddsratio surgery_type / at (age=65);

oddsratio surgery_type / at (age=70);

oddsratio surgery_type / at (age=75);


Instead of outputing the odds ratios for each surgery type at these ages, it outputs a very complex matrix involving some of the other interaction terms (ie, 

Surgery_Name Open spinal cord decompression vs Spinal fusion with vertebrectomy at Age=68 admitCategory=Elective site=Winnipeg


Any other suggestions for how to more meaningfully interpret covariates involved in multiple interactions?


Thanks in advance,



Jade | Level 19

Hi Brett,

I am going to assume that surgery_type in the ODDSRATIO statements is an exact copy of the CLASS variable Surgery_name.  If it is something else, then my surmision about what is happening is probably wrong.  There are three terms that are included as interactions with Surgery_name: admitCategory, age and site. The syntax you have would give ORs for Surgery_type at each admitCategory at each site, with age fixed at whatever value is specified. This is about as you might expect with this many levels, etc..


If you use ODS to output a dataset of the ORs, you should be able to see what each of these are, in something that might be more easily read.. 


Now I think you are asking if there is a more compact and understandable way to see the ORs, and I don't know of any offhand, but I would guess that there are some macros out there that use the output dataset to summarize in a more easily undertandable format.




In your code I assume that "surgery_type" in the ODDSRATIO statements is really specified as "surgery_name". Otherwise, errors would have been issued. The text you show from the table of Odds Ratio estimates is a proper description of one of the estimates. Note that an odds ratio in a model like this will involve parameters from the interacting variables, so the description is necessarily complex. That text tells you which two levels of surgery_name are compared and the settings of the interacting variables at which that comparison was made.


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
  • 2 replies
  • 1 like
  • 3 in conversation