BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mintbit
Obsidian | Level 7

Hi. I am having a lot of trouble figuring out how I check the linearity of a continuous predictor for logistic regression. 

My understanding is to group the con. variable into many groups and examine the line between the log-transformed odds, but I don't know how to produce the log odds? 

Also, is visual inspection sufficient or is there a statistical test i can to use to prove linearity?

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

See the "Linearity in the logit (or link), testing" item in the FASTats list of frequently asked-for statistics. It isn't necessary to categorize a continuous predictor. 

View solution in original post

10 REPLIES 10
mintbit
Obsidian | Level 7
I have read a lot of articles covering the subject, but they are way to advanced for my understanding.
FreelanceReinh
Jade | Level 19

Hi @mintbit,

 

I presented a fully worked example for this in 2018: Re: plotting logit function. My goal there was a visual inspection of the plot created. Please try to adapt this to your data and let me know if problems occur.

mintbit
Obsidian | Level 7

This is golden! Thank you so much. I worked like a charm. 

I will study to understand the code. Now I will try to make 20 levels in stead of four.

Again, than you. I have struggled so much to find this information 😄

Rick_SAS
SAS Super FREQ

Are you talking about a calibration plot?

 

If so:

1. If you have SAS/STAT 15.1 or later, use PLOTS=CALIBRATION on the PROC LOGISTIC statement. See the examples at "An easier way to create a calibration plot in SAS."

2. If you are running an older version of SAS, see "Calibration plots in SAS."

3. Although some analysts continue to use the older quantile-based calibration plots (such as a decile calibration plot), there are good reasons to avoid binning continuous data. I suggest using the methods in (1) or (2).

 

PaigeMiller
Diamond | Level 26

@Rick_SAS thanks for this. How do we know if we have SAS/STAT 15.1?

--
Paige Miller
Rick_SAS
SAS Super FREQ

Well, it is probably displayed in the log when you launch SAS, but if not:

1. You can use the SYSVLONG system macro variable to find your version of SAS.

2. SAS/STAT 15.1 was released as part of 9.4m6 in Nov, 2018. You can see the release dates for all SAS releases.

PaigeMiller
Diamond | Level 26

Thanks again @Rick_SAS .

 

TIME FOR A RANT:

I find this numbering system to be very confusing and I make no attempt to remember all of the version numbers of SAS software that I can access, other than I know I have SAS 9.4M5. I have complained to other SAS people about this, but I doubt the numbering schemes will change and become easier to remember, and so I request that from now on, if you say someone has to have some version of SAS/STAT (or whatever), let us know how we can determine what version we have. It does not help to say "If you have SAS/STAT 15.1...." without telling us how we can find this out, because I simply don't know these things and will make no attempt to know them. And I'm sure many people don't know either.

 

Instead of saying "If you have SAS/STAT 15.1..." you could have said "If you have SAS 9.4M6 or later ..." (or both) and then the issue goes away (for me, anyway).

 

Release dates are meaningless in this context, it depends on what is installed and not what the release dates are.

--
Paige Miller
ballardw
Super User

@PaigeMiller wrote:

Thanks again @Rick_SAS .

 

TIME FOR A RANT:

I find this numbering system to be very confusing and I make no attempt to remember all of the version numbers of SAS software that I can access, other than I know I have SAS 9.4M5. I have complained to other SAS people about this, but I doubt the numbering schemes will change and become easier to remember, and so I request that from now on, if you say someone has to have some version of SAS/STAT (or whatever), let us know how we can determine what version we have. It does not help to say "If you have SAS/STAT 15.1...." without telling us how we can find this out, because I simply don't know these things and will make no attempt to know them. And I'm sure many people don't know either.

 

Instead of saying "If you have SAS/STAT 15.1..." you could have said "If you have SAS 9.4M6 or later ..." (or both) and then the issue goes away (for me, anyway).

 

Release dates are meaningless in this context, it depends on what is installed and not what the release dates are.


@PaigeMiller 

 

Proc product_status shows the version numbers, at least of the products I have licensed such as:

For SAS/STAT ...
   Custom version information: 14.2

Which might help @Rick_SAS and others provide better way to let folks determine the product.

 

 

 

PaigeMiller
Diamond | Level 26

Yes, I see that @ballardw, there are definite actions I can take to find out this information, as shown above I had to ask how to find out this information. Towards the goal of better communication, the SAS employees here ought not to refer to version numbers that require me to do research to find out if I have it or not. SAS employees can simply say "You need SAS/STAT 15.1 which comes as part of SAS 9.4M6" and the entire problem is gone. Clear communication. Full information (instead of partial information) is provided. Everyone benefits. SAS customers are happier (well at least I am happier but I suspect others would benefit as well).

--
Paige Miller
StatDave
SAS Super FREQ

See the "Linearity in the logit (or link), testing" item in the FASTats list of frequently asked-for statistics. It isn't necessary to categorize a continuous predictor. 

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
  • 10 replies
  • 914 views
  • 6 likes
  • 6 in conversation