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)

Interrogating the output

We can do all kinds of output interrogation just like with binary outcomes.

What is the best decision strategy?

compare_dca(fit)

Are the prediction model or the binary test useful at all?

compare_dca(fit, type = "useful")

Is the model better than the test?

compare_dca(fit, 
            strategies = c("model_predictions", "binary_test"), 
            type = "pairwise")

What is the price of uncertainty?

compare_dca(fit, .evpi = TRUE)


giulianonetto/bayesdca documentation built on Aug. 31, 2023, 11:07 a.m.