BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
knicks1189
Fluorite | Level 6

Hi Everyone,

 

I am working with large survey data and running a logistic regression using proc surveylogistic. I have to compare the odds between two groups for various variables, so for that I included an interaction term for each variable I want . For example, my model statement is:

 

model  Var Y = A B A*B;

 

Surveylogistic doesn't give odds ratios for terms involved in interactions, but I am able to get odds for the interaction terms at various nestings using the sliceby statement. Is there any way to get the odds ratio and their 95% intervals for the main effects A, and B individually in this model? Basically I want to have a table that has the following odds ratios:

 

Var                                    Odds      CI

A                                       1.xx

B                                       1.xx

 

Various A*B slices

A1 by B                             1.XX

A2 BY B

 

I have no problem getting the values for slices, but how do I get the values and their intervals for main effects A,B?

1 ACCEPTED SOLUTION

Accepted Solutions
knicks1189
Fluorite | Level 6

I am using the latest edition of SAS UE.

 

Here is my code:

 

 

proc surveylogistic data = dataname nomcar ;
domain x;
class Age_Bucket (ref = '1')
Female (ref = '1')
Race (ref = '1')
A (ref = '3')
B(ref = '0')
/ param = glm;
strata nis_stratum;
cluster hosp_nis;
weight discharge_weight;


model cholecystectomy (event = '1') =

AGE_BUCKET
FEMALE
RACE
A
B
mortal_score

/* Interaction Terms */

A*B





/ clodds vadjust = none ;



slice A*B/ sliceby=A diff oddsratio cl adjust=bon ;
slice A*B/ sliceby=B diff oddsratio cl adjust=bon ;


run;

 

How do I get the individual main effect odds ratios of SNH and PAY1 individually? 

View solution in original post

3 REPLIES 3
ballardw
Super User

You might show the existing code you are using. That might help someone provide suggestions.

And if you aren't running SAS 9.4 in some form you might indicate the version. There have been additions to the survey procs with each release.

 

knicks1189
Fluorite | Level 6

I am using the latest edition of SAS UE.

 

Here is my code:

 

 

proc surveylogistic data = dataname nomcar ;
domain x;
class Age_Bucket (ref = '1')
Female (ref = '1')
Race (ref = '1')
A (ref = '3')
B(ref = '0')
/ param = glm;
strata nis_stratum;
cluster hosp_nis;
weight discharge_weight;


model cholecystectomy (event = '1') =

AGE_BUCKET
FEMALE
RACE
A
B
mortal_score

/* Interaction Terms */

A*B





/ clodds vadjust = none ;



slice A*B/ sliceby=A diff oddsratio cl adjust=bon ;
slice A*B/ sliceby=B diff oddsratio cl adjust=bon ;


run;

 

How do I get the individual main effect odds ratios of SNH and PAY1 individually? 

SAS_Rob
SAS Employee

I don't see those two variables actually listed in the model, but I assume you are asking about the variables A and B.

Using the LSMEANS statement with the SLICEBY and ODDSRATIO options should give you what you want.  I think some of the confusion may be in the fact that with an interaction you are assuming that there are multiple odds ratios for each level of the second variable.

In other words, when you are looking at the odds ratio comparing A=1 vs A=2, there wil be a different odds ratio for each level of B.  So you won't get a single odds ratio unless you remove the interaction.

 

This usage note might also be helpful for you as well.

http://support.sas.com/kb/24/455.html

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 3 replies
  • 3974 views
  • 0 likes
  • 3 in conversation