Programming the statistical procedures from SAS

Binary logistic regression output format: false vs. true AS OPPOSED TO true vs. false

Reply
Occasional Contributor
Posts: 7

Binary logistic regression output format: false vs. true AS OPPOSED TO true vs. false

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?

 

 

Super User
Posts: 23,774

Re: Binary logistic regression output format: false vs. true AS OPPOSED TO true vs. false

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?

 

 


 

Occasional Contributor
Posts: 7

Re: Binary logistic regression output format: false vs. true AS OPPOSED TO true vs. false

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?

Super User
Posts: 23,774

Re: Binary logistic regression output format: false vs. true AS OPPOSED TO true vs. false

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' is
to 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;
Occasional Contributor
Posts: 7

Re: Binary logistic regression output format: false vs. true AS OPPOSED TO true vs. false

 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.

Super User
Posts: 23,774

Re: Binary logistic regression output format: false vs. true AS OPPOSED TO true vs. false

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.


 

Ask a Question
Discussion stats
  • 5 replies
  • 122 views
  • 4 likes
  • 2 in conversation