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 package survival
and can use the Surv()
function in the canonical formula interface, and there is also a reference to survfit()
in the basehaz.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 function reconstructGBMdata()
.
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.
Similar Posts:
- Solved – How to manually calculate `survfit` in cox hazard model
- Solved – R packages (or SAS code) to produce two simultaneous Kaplan-Meier curves
- Solved – Survival Analysis in Hockey – Usage of coxph and survfit
- Solved – Estimate Survival Function from hazard function — an inconsistent result between basehaz and survfit function
- Solved – Estimate Survival Function from hazard function — an inconsistent result between basehaz and survfit function