Description Usage Arguments Examples
View source: R/plot_explainer.R
Function plot for surv_explainer object visualise estimated survival curve of mean probabilities in chosen time points.
1 2 |
x |
object of class "surv_explainer" |
... |
other arguments for function |
1 2 3 4 5 6 7 8 9 10 11 12 | library(survxai)
library(rms)
data("pbcTest")
data("pbcTrain")
predict_times <- function(model, data, times){
prob <- rms::survest(model, data, times = times)$surv
return(prob)
}
cph_model <- cph(Surv(years, status)~sex + bili + stage, data=pbcTrain, surv=TRUE, x = TRUE, y=TRUE)
surve_cph <- explain(model = cph_model, data = pbcTest[,-c(1,5)],
y = Surv(pbcTest$years, pbcTest$status), predict_function = predict_times)
plot(surve_cph)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.