Turn on suggestions

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

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Re: How to get crude odds ratio for binary outcome variable and catego...

Options

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 03-26-2019 08:43 PM
(1611 views)

Hi!

I'm a novice with SAS - using SAS University Edition - and am trying to run an odds ratio using proc logistic. I'm looking to find the odds of a respondent experiencing mental health issues (a binary variable titled mentalhealth_2008, where '1' indicates experiencing mental health issues) by their insurance type (categorical with 4 categories: 1, 2, 3, 4). Here's the code I'm using:

proc surveylogistic data=work.nsduh082;

class insurancetype / param=ref;

model mentalhealth_2008 (event=first) = insurancetype / covb;

weight ANALWT_C;

run;

My results do show me the ORs, but they show me the OR of insurance type 1 vs. 4; 2 vs. 4; and 3 vs. 4. But I just want to know the crude odds of each insurance type.

Is there something wrong with my code? How can I get SAS to report the crude odds for each level of insurance variable?

6 REPLIES 6

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hello,

What you have there are crude odds ratios. Since 'insurancetype' is a categorical variable with four levels, one level should be used as a reference. Otherwise, the computation of odds would be meaningless.

Hope it helps!

Thank you,

Rajesh.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Rajesh,

Thank you! That makes sense. I have a follow up question. I'd like to stratify my odds ratios by covariates, e.g. race (variable name: "race"). So I'd like to see what the ORs are for respondents with private insurance who are (1) white, (2) black/african american. etc. My code for looking at OR among respondents with private insurance looks like this:

proc surveylogistic data=work.nsduh082;

class insurance_private / param=ref;

model mentalhealth_2008 (event=first) = insurance_private / covb;

weight ANALWT_C;

run;

Is there some sort of statement I can use to tell SAS to stratify my odds by race? Thank you!

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

If you think that the odds ratios change according to race, then you are saying that you expect race to interact with insurance. So, specify this model and then use the ODDSRATIO statement:

model mentalhealth_2008 (event=first) = insurance_private race insurance_private*race ;

oddsratio insurance_private;

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

You would need to add RACE to your model, e.g.

class insurance_private race / param=glm;

model mentalhealth_2008 (event=first) = insurance_private|race;

Then you could add the LSMEANS statement with the DIFF and OR option to get the odds ratios

This paper has a specific example that you can follow:

http://support.sas.com/resources/papers/proceedings14/SAS404-2014.pdf

class insurance_private race / param=glm;

model mentalhealth_2008 (event=first) = insurance_private|race;

Then you could add the LSMEANS statement with the DIFF and OR option to get the odds ratios

This paper has a specific example that you can follow:

http://support.sas.com/resources/papers/proceedings14/SAS404-2014.pdf

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

@kwrigh28 wrote:Hi!

I'm a novice with SAS - using SAS University Edition - and am trying to run an odds ratio using proc logistic. I'm looking to find the odds of a respondent experiencing mental health issues (a binary variable titled mentalhealth_2008, where '1' indicates experiencing mental health issues) by their insurance type (categorical with 4 categories: 1, 2, 3, 4). Here's the code I'm using:

proc surveylogistic data=work.nsduh082;

class insurancetype / param=ref;

model mentalhealth_2008 (event=first) = insurancetype / covb;

weight ANALWT_C;

run;

My results do show me the ORs, but they show me the OR of insurance type 1 vs. 4; 2 vs. 4; and 3 vs. 4. But I just want to know the crude odds of each insurance type.

Is there something wrong with my code? How can I get SAS to report the crude odds for each level of insurance variable?

You haven't specified any sampling strata or clusters which the NSDUH should provide. Was that intentional?

**Available on demand!**

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

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.