knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.width = 12, fig.height = 7, dpi = 300 )
To illustrate Bayesian DCA on survival data, we load the example dataset dca_survival_data
shown below.
library(bayesDCA) head(dca_survival_data)
The dataset contains the time-to-event outcomes
(a survival::Surv
object), the predictions from a prognostic model, and the results from a binary prognostic test. The time horizon for the event prediction is one time units (e.g., year), so we set prediction_time = 1
. We also set chains = 1
to speed up MCMC sampling with Stan (in practice you should use at least chains = 4
, maybe with cores = 4
for speed as well).
fit <- dca_surv(dca_survival_data, prediction_time = 1, iter = 1000, chains = 1) plot(fit)
We can do all kinds of output interrogation just like with binary outcomes.
compare_dca(fit)
compare_dca(fit, type = "useful")
compare_dca(fit, strategies = c("model_predictions", "binary_test"), type = "pairwise")
compare_dca(fit, .evpi = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.