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
- /
- proc logistic - odds ratio for interaction terms

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

04-23-2013 01:49 PM

I am running a logistic regression and I need odds ratios and confidence limits for interaction terms using proc logistic.

I am using the contrast statement but don't know if the matrix I have specified is right.

For example, I am looking at the following interactions, 1) group*age and 2) group*sex where group, age and sex are categorical variables having values 1 and 0. The formatting of the variables is as follows:

Sex = 1 if Sex='Male' or Sex=0 if Sex='Female'

Age = 1 if the age of a particular subject is greater than the median age or 0 otherwise.

group = 1 if treatment = 'A' , group = 0 if treatment='B'

Here is the SAS code:

/* All variables below including scin_30day are categorical variables with values 1 and 0 EXCEPT

for the variable BASE which is continuous*/

/*I need to add interaction terms group*age, group*sex, group*BMIn, group*VIsn to the model and see if they are significant

and at the same time need Odds ratios and CL values in the output dataset*/

/*Do I specify the interactions in the contrast statement, if yes, how do I write the contrast statements for the

interactions above??*/

PROC LOGISTIC DATA = final_dataset descending;

class group agen Male racen DIABn CR2n logn stsn

ECMRGn EFN Frailn scoren MMSEn BMIn VISn;

MODEL scin_30day = group BASE agen Male racen DIABn CR2n logn stsn

ECMRGn EFN Frailn scoren MMSEn BMIn VISn/rsquare lackfit;

ods output ParameterEstimates=dPara1 OddsRatios=dOdds1;

RUN;

Accepted Solutions

Solution

07-03-2017
09:54 AM

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

04-23-2013 10:07 PM

Hi.

This link is very helpful.

24447 - Examples of writing CONTRAST and ESTIMATE statements

if you scan through it (go to Example 3) you will see how to set up your code to get the CI and OR.

Also, you may search this forum for "interaction term in logistic regression" and find helpful answers.

Anca.

All Replies

Solution

07-03-2017
09:54 AM

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

04-23-2013 10:07 PM

Hi.

This link is very helpful.

24447 - Examples of writing CONTRAST and ESTIMATE statements

if you scan through it (go to Example 3) you will see how to set up your code to get the CI and OR.

Also, you may search this forum for "interaction term in logistic regression" and find helpful answers.

Anca.

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

04-23-2013 10:38 PM

Not sure you need a contract statement, but what you do need is to add /param=ref to the end of your class statement.

Add your interaction terms to the model statement.

Add the oddsratio statement for the odds ratio you're interested in (assuming at least 9.2+ I think).

You may have to change your ods table names to get different tables.

See here for further reference on getting estimates for odds ratios:

24455 - Estimating an odds ratio for a variable involved in an interaction

PROC LOGISTIC DATA = final_dataset descending;

class group agen Male racen DIABn CR2n logn stsn

ECMRGn EFN Frailn scoren MMSEn BMIn VISn/param=ref;

MODEL scin_30day = group BASE agen Male racen DIABn CR2n logn stsn

ECMRGn EFN Frailn scoren MMSEn BMIn VISn group*age group*sex add other interaction terms here/rsquare lackfit;

oddsratio agen;

oddsratio male;

oddsratio group/at=(age=0);

ods output ParameterEstimates=dPara1 OddsRatios=dOdds1;

RUN;