Solved – How to explain smoothing functions in the logistic regression model

logisticsmoothing

I fitted a logistic regression model with some smoothing functions, and the software made beautiful plots for them. Here is one example:

enter image description here

My main concern is that there is no reference level in the continuous variable, so converting the estimates by an exponential function to odds ratio seems not quite right for smoothing functions. Hence, I am wondering how to explain smoothing functions appropriately?

Here is a part of output of the above smoothing function:

age estimate  95% CI
18  0.802419 (0.708936, 0.90305)
19  0.744268 (0.666983, 0.823497)
20  0.688122 (0.625178, 0.755262)
21  0.634746 (0.57693, 0.69252)
22  0.584887 (0.530877, 0.638431)
23  0.538855 (0.485444, 0.589725)
24  0.496467 (0.44487, 0.550205)
25  0.457521 (0.405356, 0.511471)
26  0.421809 (0.370094, 0.47534)
27  0.389193 (0.340622, 0.441149)

Any suggestion will be appreciated!

Best Answer

The reference age is the age that your function cuts the x-axis (around 67, maybe, by eyeballing your graph). Whatever, let's say that it is 67. The odds ratio is the odds of the event (probability of the event divided by one minus the probability of the event), given the person's age divided by the odds of the event given the age=67: \begin{equation} \frac{\frac{P\{E|age\}}{1-P\{E|age\}}}{\frac{P\{E|67\}}{1-P\{E|67\}}}= \frac{exp(f(age))}{exp(f(67))}=exp(f(age)) \end{equation} So, the odds ratio for an 18-year-old relative to a 67-year-old would be $exp(0.8)=2.22$, or the 18-year-old has odds of the event 222% as high as the 67-year-old.

If you don't want the reference age to be 67, then you can make it anything you like via subtraction. If you want the reference age to be 18, then just subtract 0.8 from the value of f(age) for every value of age. Then the odds ratio for a 27-year-old, compared to (now) an 18-year-old is $exp(0.39-0.80)=0.66$, or the 27-year-old has odds 66% as high as the 18-year-old to have the event.

Related Question