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
- /
- Binary logistic regression output format: false vs. true AS OPPOSED TO...

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 07-04-2018 08:31 PM
(1369 views)

Hello,

I have a question regarding the output format in a binary logistic regression. By default, SAS is generating false vs. true format for my binary logistic regression. Is there a way to get this format to be true vs. false instead?

5 REPLIES 5

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

Yes, in the MODEL statement you can specify the definition of an event.

`model myVariable (event='False') = .... ;`

@mj8000 wrote:

Hello,

I have a question regarding the output format in a binary logistic regression. By default, SAS is generating false vs. true format for my binary logistic regression. Is there a way to get this format to be true vs. false instead?

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

Thank you for your response. Here's my code snippet:

ods noproctitle;

ods graphics / imagemap=on;

proc logistic data=Work.SortTempTableSorted

plots=(oddsratio(cldisplay=serifarrow) );

class sex cancer DM / param=glm;

model PainExists_1y(event='true')=sex cancer DM / link=logit technique=fisher;

by pre_op_pain;

run;

In this case, I want PainExists_1y to be 'true', but I want my classification variable (cancer) to generate odds ratios of true vs. false (right now it's giving me false vs. true). Given your suggestion, where would I add the modification?

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

In this case, I want PainExists_1y to be 'true', but I want my classification variable (cancer) to generate odds ratios of true vs. false (right now it's giving me false vs. true). Given your suggestion, where would I add the modification?

I think you're interpreting it incorrectly or not specifying your event correctly.

That's exactly what it should be giving you. Check your log to verify what is being modelled. Note that True is not the same as true as TRUE etc, it is case sensitive. Usually it would be PARAM=REF to get the comparison rather than GLM, but that's ultimately your choice for what suits your analysis.

You'll see a note like this:

NOTE: PROC LOGISTIC is modeling the probability that Pain='No'. One way to change this to model the probability that Pain='Yes' isto specify the response variable option EVENT='Yes'.

You can add expb to the MODEL options to get the ODDS ratio or the ODDSRATIO statement itself to get the ODDS Ratio estimates.

model PainExists_1y(event='true')=sex cancer DM / link=logit technique=fisher **expb;**

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

I think I may have been running my analysis backwards. I think I need to set my "Event of interest" = false, so that any Odds Ratio that I see greater than 1 means there's a higher chance of my event happening. Is this a correct interpretation?

Previously I had set my "Event of interest" = true.

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

If your event is true, you get the odds of getting a true event compared to either a single unit increase for a continuous variable and compared to your reference level with a PARAM=REF model. If you're using GLM, I'm not sure how to interpret the ratio to be honest.

You can work through the second example in PROC LOGISTIC and it has the odds ratio with a categorical predictor and how it's interpreted halfway through and then replicate that on your data once you understand how it works.

@mj8000 wrote:

I think I may have been running my analysis backwards. I think I need to set my "Event of interest" = false, so that any Odds Ratio that I see greater than 1 means there's a higher chance of my event happening. Is this a correct interpretation?

Previously I had set my "Event of interest" = true.

**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.