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 |
survObj.new |
a list containing observed data from new subjects with
components |
type |
option to chose for predicting survival probabilities (one of
|
method |
option to use the posterior mean ( |
times |
time points at which to evaluate the risks. If |
... |
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)