# \donttest{
library(survival)
library(survex)
cph <- coxph(Surv(time, status) ~ ., data = veteran, model = TRUE, x = TRUE, y = TRUE)
rsf_src <- randomForestSRC::rfsrc(Surv(time, status) ~ ., data = veteran)
cph_exp <- explain(cph)
rsf_src_exp <- explain(rsf_src)
cph_predict_profile <- predict_profile(cph_exp, veteran[2, -c(3, 4)],
variables = c("trt", "celltype", "karno", "age"),
categorical_variables = "trt"
)
plot(cph_predict_profile, facet_ncol = 2)
rsf_predict_profile <- predict_profile(rsf_src_exp, veteran[5, -c(3, 4)], variables = "karno")
plot(cph_predict_profile, numerical_plot_type = "contours")
# }
Run the code above in your browser using DataLab