predict.psbcSpeedUp {psbcSpeedUp}R Documentation

Predict survival risk

Description

Predict survival probability, (cumulative) hazard or (integrated) Brier scores based on Cox regression models

Usage

## S3 method for class 'psbcSpeedUp'
predict(
  object,
  survObj.new = NULL,
  type = "brier",
  method = "mean",
  times = NULL,
  ...
)

Arguments

object

fitted object obtained with psbcSpeedUp

survObj.new

a list containing observed data from new subjects with components t, di, x. If NULL, the prediction is based on the training data. If type is among c("hazard", "cumhazard", "survival"), only survObj.new$x is needed

type

option to chose for predicting survival probabilities (one of c('hazard','cumhazard','survival')) or brier scores (type="brier")

method

option to use the posterior mean ("mean") of coefficients for prediction or Bayesian model averaging ("BMA") for prediction

times

time points at which to evaluate the risks. If NULL (default), the event/censoring times are used. If type="brier", the largest one of the times is used

...

not used

Details

psbcSpeedUp

Examples


# Load the example dataset
data("exampleData", package = "psbcSpeedUp")
p <- exampleData$p
q <- exampleData$q
survObj <- exampleData[1:3]

# Set hyperparameters
mypriorPara <- list(
  "groupInd" = 1:p, "eta0" = 0.02, "kappa0" = 1, "c0" = 2, "r" = 10 / 9,
  "delta" = 1e-05, "lambdaSq" = 1, "sigmaSq" = runif(1, 0.1, 10),
  "beta.prop.var" = 1, "beta.clin.var" = 1)


# run Bayesian Lasso Cox
library("psbcSpeedUp")
library("survival")
set.seed(123)
fitBayesCox <- psbcSpeedUp(survObj,
  p = p, q = q, hyperpar = mypriorPara,
  nIter = 10, burnin = 0, outFilePath = tempdir()
)
# predict survival probabilities of the train data
predict(fitBayesCox)



[Package psbcSpeedUp version 2.0.7 Index]