Predicts survival/hazard/density/mean/sd for a given RoBSA object. Either predicts values for each row of a fully specified new_data data.frame, or for all levels of a given predictor at the mean of continuous covariate values and default factor levels or covariate values specified as covariates_data data.frame.

# S3 method for RoBSA
predict(
  object,
  time = NULL,
  new_data = NULL,
  predictor = NULL,
  covariates_data = NULL,
  type = c("survival", "hazard", "density", "mean", "sd"),
  summarize = TRUE,
  averaged = TRUE,
  conditional = FALSE,
  samples = 10000,
  ...
)

Arguments

object

a fitted RoBSA object

time

a vector of time values at which the survival/hazard/density will be predicted (for each passed data point)

new_data

a data.frame containing fully specified predictors for which predictions should be made

predictor

an alternative input to new_data that automatically generates predictions for each level of the predictor across all either across levels of covariates specified by covariates_data or at the default values of other predictors

covariates_data

a supplementary input to predictor that specifies levels of covariates for which predictions should be made

type

what type of prediction should be created

summarize

whether the predictions should be aggregated as mean and sd. Otherwise, prediction for for posterior samples is returned.

averaged

whether predictions should be combined with Bayesian model-averaging or whether predictions for each individual model should be returned.

conditional

whether only models assuming presence of the specified predictor should be used

samples

number of posterior samples to be evaluated

...

additional arguments (unused)

Value

a list with predictions (or a list of lists in case that predictions for each individual model are requested averaged = FALSE)