BookmarkSubscribeRSS Feed
sms1891
Quartz | Level 8

Hi all,

I am working on a data set which has repeated observations (ID). I would like to get odds ratio for an out of interest (BloodCult) for a set of factors that influence the outcome. Some of these factors are categorical and some are continuous. Some of the categorical variables are more than two levels (binomial and multinomial). I would appreciate if anyone can help me with the SAS code. 

BloodCult is outcome (0/1)

LOS is a continuous variable

Disc_Status and Ward have more than two levels (ref = 1)

Rest of the variables are binomial (0/1) . Can use ref=0.

I tried the following but I am not getting the odds ratio estimates with 95% CI for the factors.

 

Thank you!

proc genmod data=SIRS.Temp_Blood_Demo_ICD_Combined descending; 
class  ID Race FebrileFlag  Temp_HAI  Temp_Grp  ELX_GRP_1  ELX_GRP_10  DM 
ELX_GRP_15  ELX_GRP_14   ELX_GRP_17  SIRS  Ward Disc_Status ;
model BloodCult =Race FebrileFlag Temp_HAI Temp_Grp ELX_GRP_1 ELX_GRP_10 DM ELX_GRP_15 ELX_GRP_14  ELX_GRP_17 SIRS Ward  Disc_Status LOS / dist=bin;
repeated subject = ID/ type=exch covb corrw;
estimate LOS 1/ exp;
lsmeans Race FebrileFlag Temp_HAI Temp_Grp ELX_GRP_1 ELX_GRP_10 DM ELX_GRP_15 ELX_GRP_14  ELX_GRP_17 SIRS /diff exp cl;
run;
3 REPLIES 3
sms1891
Quartz | Level 8

Thanks for the response. I have reviewed this report prior to posting my question. Is there a better way for getting odds ratio for 10+ predictors without stating estimate and lsmeans statement for each and every variable? My categorical variables are 0/1 for most of them except two where I have more than two categories. I would like to get OR for all other levels of these two variables keeping one level as a control.

 

 

StatDave
SAS Super FREQ

GENMOD fits the broad range of generalized linear models and does not focus exclusively on the logistic model, which is the only model for which odds ratios are possible, so it does not automatically produce odds ratio estimates for the predictors like PROC LOGISTIC does. You will need one LSMEANS statement for all your categorical predictors (you can specify multiple predictors in one LSMEANS statement) and an ESTIMATE statement for each continuous predictor. By the way, as mentioned in the note, you can use the ODDSRATIO option in the LSMEANS statement instead of the EXP option to get better labeling in the output. 

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 25. 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
  • 3 replies
  • 1641 views
  • 0 likes
  • 2 in conversation