- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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?
- 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
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
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.
- 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?