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

## proc surveylogistic - how to get odds ratio of main effects for an interaction variable?

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
Fluorite | Level 6

## Re: proc surveylogistic - how to get odds ratio of main effects for an interaction variable?

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?

3 REPLIES 3
Super User

## Re: proc surveylogistic - how to get odds ratio of main effects for an interaction variable?

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.

Fluorite | Level 6

## Re: proc surveylogistic - how to get odds ratio of main effects for an interaction variable?

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 Employee

## Re: proc surveylogistic - how to get odds ratio of main effects for an interaction variable?

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

Discussion stats
• 3 replies
• 4059 views
• 0 likes
• 3 in conversation