Nothing
## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")
run <- requireNamespace("ranger", quietly = TRUE)
## ----eval = run---------------------------------------------------------------
library(survalis)
f <- Surv(time, status) ~ age + karno + celltype
m <- fit(f, veteran, "ranger", spec = list(num.trees = 200), seed = 1)
round(as.matrix(predict(m, veteran[1:3, ], times = c(90, 180))), 3)
predict(m, veteran[1:3, ], times = c(90, 180), type = "rmst")
## -----------------------------------------------------------------------------
expo <- list(
name = "exponential",
fit = function(formula, data, ...) survival::survreg(formula, data, dist = "exponential"),
predict = function(object, newdata, times) {
rate <- 1 / predict(object, newdata, type = "response")
exp(-outer(rate, times))
}
)
evaluate(Surv(time, status) ~ age + karno, veteran, model = expo,
times = c(90, 180), resampling = cv(3, seed = 1))
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.