BookmarkSubscribeRSS Feed
mihhghjl
Calcite | Level 5

I have a binary dependent variable (casenum) and five binary independent variables (1 or 0) with no interactions. I am running a logistic regression model and I want to determine the odds ratios. I am confused by which odds ratio is the correct one. Do I use the odds ratio calculated using a dummy/indicator or the exponentiated estimate from the default effects coding?

 

Below is my code and output (PDF) using the default effects coding: 
 
Proc logistic data=study.qs;
class '28cat01'n "11ayn"n "18yn"n "66acatyn"n  '32yn'n;
model casenum= '28cat01'n "11ayn"n "18yn"n "66acatyn"n  '32yn'n/  expb;
run;
 
 
 
2 REPLIES 2
StatDave
SAS Super FREQ

You should use the results in the default Odds Ratio Estimates table. The EXPB option should rarely be used and will not generally give the desired results, particularly when the default effects coding is used for CLASS variables.

Reeza
Super User
Proc logistic data=study.qs;
class '28cat01'n "11ayn"n "18yn"n "66acatyn"n  '32yn'n / param=REF;
model casenum= '28cat01'n "11ayn"n "18yn"n "66acatyn"n  '32yn'n/  expb;

oddsratio '28cat01'n;
oddsratio "11ayn"n;
oddsratio "18yn"n;
....
run;

I'd highly recommend changing those variable names to something easier to type - put the YN first for example. It'll save you a lot of typing.

 

EDIT: You need to add PARAM=REF to the CLASS statement to ensure the parameterization of your categorical variables is correct. Assuming you want dummy coding, PARAM=REF is the specification you want. 

You can use EXPB but the ODDSRATIO statement is clearer and easier to interpret. See the example above. 

 


@mihhghjl wrote:

I have a binary dependent variable (casenum) and five binary independent variables (1 or 0) with no interactions. I am running a logistic regression model and I want to determine the odds ratios. I am confused by which odds ratio is the correct one. Do I use the odds ratio calculated using a dummy/indicator or the exponentiated estimate from the default effects coding?

 

Below is my code and output (PDF) using the default effects coding: 
 
Proc logistic data=study.qs;
class '28cat01'n "11ayn"n "18yn"n "66acatyn"n  '32yn'n;
model casenum= '28cat01'n "11ayn"n "18yn"n "66acatyn"n  '32yn'n/  expb;
run;
 
 
 

 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!

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
  • 1113 views
  • 2 likes
  • 3 in conversation