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. 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1297 views
  • 0 likes
  • 2 in conversation