I’ve come across two methods for evaluating the linearity assumption for logistic regression (i.e., whether there is a linear relationship between continuous predictor variables and the logit of the outcome):
- Box-Tidwell: For any continuous predictor in the model, include the product of that variable and its natural logarithm (i.e., x * log(x)) as an additional predictor, and see if it comes out significant. If it does, the linearity assumption is likely violated for that variable. See here for a CV discussion.
- Visual inspection: Visually inspect the scatter plot between each continuous predictor and the logit values, like in this STHDA example.
The problem is that I get different verdicts from these two methods, so am not sure which one to go with (if either).
Based on the models I’ve been testing so far, it seems that, when Box-Tidwell suggests non-linearity, the visual inspection method concurs; but the latter method suggests non-linearity in several cases where Box-Tidwell does not.
For example, this looks non-linear to me, but the Box-Tidwell method doesn't flag it (p-value: 0.177646):
Any advice here (on the general question of what method to use - not on this particular example) would be greatly appreciated.