turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Oddratio statement in in PROC logistic

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-27-2016 05:11 AM

if i have a model like this;

proc logistic data=saslib.sad_PLFO;

where PLFO in (0,1);

class sex race presents education wealth region / param=ref;

model PLFO (event='1') = age sex race presents education wealth region age*education wealth*region region*education;

run;

How do I seperately get the odds ratio for all the ten variables in the model using the oddratio statement in proc logistic. Since the variable region is invoved in two different interaction.

thanks

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-27-2016 08:39 AM

Hi,

I'm not sure, but I think that is the exponential of the estimate. You could calculate it exporting the estimations or with the option expb in the model.

```
ods output ParameterEstimates=_PEst;
proc logistic data=sashelp.class;
class sex;
model sex(ref="F") = Age Weight Height / expb ;
run;
```

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-27-2016 10:49 AM

Thank, I thought of that but the values I get are different from the values of the odds ratio estimate, I have checked that for the variables not in the interaction.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-28-2016 02:27 AM

ods output OddsRatios=OddsRatios; proc logistic data=sashelp.class; class sex; model sex(ref="F") = Age Weight Height ; oddsratio age; run;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-28-2016 03:00 AM

thank you so much, but that is quit easy. But from my example one variable is invoveld in two seperate interaction.

what if I want to get the odds ratio for educatio*region without wealth since region is also involved in interaction with wealth?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-28-2016 03:18 PM

You can not *separately* get an odds ratio of the variables that are involved in some interactionsterms. But, you can easily get the oddsratios for a variable for each level of the other variable it interacts with: just use the "at" option in the odds ratio statement. Like in this example which calculate the oddsratio for the variable A at each level of B, and the oddsratio for B for at level of A.

```
data mydata;
n=1000;
do a=0 to 1;
do b=0 to 1;
odds=(1.2**a)*(0.75**b)*(0.8**(a*b));
p=odds/(1+odds);
y=rand('binomial',p,n);
output;
end;
end;
run;
proc logistic data=mydata;
class a(ref="0") b(ref="0")/param=glm ;
model y/n=a b a*b;
oddsratio a/at(b=all) diff=ref;
oddsratio b/at(a=all) diff=ref;
run;
```