I just fitted a boosted regression coxph model:
cox=gbm(Surv(periods, event) ~ grade + fico_range_low + revol_util + dti, data=notes)
However, I want to obtain the survival curve from the model similar to the survfit()
function in the survival
package. Does anyone know how to obtain using the model from the gbm
package?
Best Answer
Since package
gbm
requires packagesurvival
and can use theSurv()
function in the canonical formula interface, and there is also a reference tosurvfit()
in thebasehaz.gbm()
documentation in the gbm vignette, it might be possible to pull out what you're looking for using the gbm model object. I doubt it, though, based on what I've read so far.So you might have to go to the source code and make your own function to extract or reconstruct what you need to mimic
plot(survfit())
. See also the (hidden) helper functionreconstructGBMdata()
.I also wanted to comment on using gradient boosting models, specifically for handling missing values. The short answer here is that the gbm algorithm handles missing values explicitly, obviating the need for user-handled imputation. I suggest looking up package rpart if you want to understand the technical details better.