I do a survival regression on some time-to-event data (vehicle breakdowns) with some covariates (essentially the age of the vehicle and some boolean variables for vehicle type). I must admit that I am not so sure about the quality of the data and whether they result from multiple processes instead of one.
For the implementation, I use the Python package lifelines
and the CoxPH fitter in particular.
This is the distribution of survival times in my data (for both censored and non-censored points!):
Here is the model summary:
<lifelines.CoxPHFitter: fitted with 2081 total observations, 354 right-censored observations>
duration col = 'duration'
event col = 'observed'
cluster col = 'vehicle'
robust variance = True
baseline estimation = breslow
number of observations = 2081
number of events observed = 1727
partial log-likelihood = -11593.48
time fit was run = 2023-03-18 06:32:51 UTC
---
coef exp(coef) se(coef) coef lower 95% coef upper 95% exp(coef) lower 95% exp(coef) upper 95%
covariate
year_of_manufacture 0.05 1.06 0.01 0.03 0.08 1.03 1.08
N7411 0.90 2.46 0.18 0.54 1.26 1.72 3.52
N7412 1.25 3.50 0.18 0.91 1.60 2.48 4.94
N7413 1.13 3.11 0.17 0.80 1.46 2.24 4.31
N7460 -0.47 0.63 0.33 -1.12 0.19 0.33 1.21
N7440 0.76 2.14 0.20 0.38 1.14 1.46 3.13
cmp to z p -log2(p)
covariate
year_of_manufacture 0.00 4.15 <0.005 14.86
N7411 0.00 4.95 <0.005 20.33
N7412 0.00 7.11 <0.005 39.68
N7413 0.00 6.76 <0.005 36.06
N7460 0.00 -1.39 0.16 2.61
N7440 0.00 3.89 <0.005 13.28
---
Concordance = 0.56
Partial AIC = 23198.95
log-likelihood ratio test = 163.41 on 6 df
-log2(p) of ll-ratio test = 106.14
This is how the modeled baseline hazard looks:
I now have some questions:
(Red dots indicate censored values, blue dots indicate events).
I assume that this pattern indicates that the model is missing some crucial feature which allows it to explain the visible non-linear relation between explanatory and target variable. And it seems to me that the model is underestimating hazard for low durations and overestimating it for large durations (please correct me if I am wrong).
- But why can't the model adapt the hazard function to this slope, as the baseline hazard is non-parametric and thus not bound to any specific distribution of survival times?
- Besides adding other covariables: What could I do to improve the model?
- Is my interpretation correct that the model says all features except N7460 do have a significant effect on the outcome and that a concordance value of 0.56 tells us that the model does slightly better than plainly guessing average values?