Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Binary logistic regression output format: false vs...

- 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
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

2 weeks ago

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
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to mj8000

2 weeks ago

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
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Reeza

2 weeks ago

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
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to mj8000

2 weeks ago

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
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Reeza

2 weeks ago

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
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to mj8000

2 weeks ago

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.