BookmarkSubscribeRSS Feed
kwrigh28
Calcite | Level 5

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
Rajesh3
Obsidian | Level 7

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.

kwrigh28
Calcite | Level 5

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!

StatDave
SAS Super FREQ

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;

SAS_Rob
SAS Employee
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


StatDave
SAS Super FREQ

As the name implies, an "odds ratio" is ratio of two odds. For a continuous predictor, the two odds differ by one unit. For a categorical (CLASS) predictor like yours, the two odds are for two levels of the predictor. PROC LOGISTIC (and PROC SURVEYLOGISTIC that you are using) uses the odds of the reference level (by default, the last level) in the denominator of the odds ratio. You can get the odds for each level of the predictor, but an odds ratio for each level does not make sense. 

DWilson
Pyrite | Level 9

@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?

sas-innovate-2024.png

Available on demand!

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

 

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
  • 6 replies
  • 1521 views
  • 0 likes
  • 5 in conversation