I am trying to perform a logistic regression to model likelihood of receiving a procedure given a certain diagnosis. There are several covariates to analyze but one of the main ones is patient age. As a background to understanding the data, the incidence of this disease is highest among younger individuals and it is possible to understand outcomes as a dichotomous variable represented by “requires X procedure” or “does not require X procedure.”
My hypothesis was that because the incidence of this disease is lower in older individuals, it is possible that the likelihood of a poor outcome is higher due to delay in diagnosis (with the potential for many confounders that I would include in the analysis as best as possible). When I analyzed the distribution of the data, on first glance it appears that this may be the case:
Presented as percent receiving "X" in equal weight age bins:
The trend in younger individuals has been described, but not the trend in older individuals.
However, when I compute the logistic regression, the model fits very poorly due to the non-linear relationship. See the Negelkerk R-squared Hosmer and Lemeshow statistics below. Looking at the classification table, the sensitivity of the model is 0, which I believe I should interpret as the model correctly predicting none of the patients who undergo the procedure.
Analyzing the change in deviance and Cook’s distances shows a pattern to the model’s error, as expected due to the non-linear relationship.
Although I understand that the linearity assumption of the logistic regression is frequently violated, it seems obvious that this violation is too flagrant. However, I am at a loss for how to appropriately combine a non-linear transformation and a logistic regression. I would like to be able to describe an adjusted odds ratio for risk of procedure binned by age, if indeed it is significant.
Computing the regression with AGE and AGE^2 as terms increases the sensitivity slightly (to 8%) but the Negelkerk R-squared is still 0.042 and the Hosmer and Lemeshow statistic is 0.000. Adding a cubed term increases sensitivity to 11%, N-R-squared is 0.049 and H+L stat is 0.085. The change in deviance plot appears slightly more favorable:
My question now is two-part: 1) Is there any transformation that would help the model fit better at the extremes? (Or simply increase sensitivity?) 2) How would I combine the exponentiated "B" coefficients to interpret one odds ratio as a function of age? My intuition is to somehow solve the B1,AGE^3+B2,AGE^2+B3,AGE+constant expression for a series of arbitrary age bins and combine the confidence intervals in a similar fashion, but this is definitely something I am not confident about.
Once again, thank you for any help or direction to information/tutorials!