Function to predict probabilities from a survfit object

# S3 method for survfit
predict(
  object,
  newdata = NULL,
  timevar = rlang::sym(".Ymin"),
  type = "surv",
  times = NULL,
  ...
)

Arguments

object

the results of a survfit fit

newdata

Optional new data at which to do predictions. If absent predictions are for the data frame used in the original fit

timevar

Name of time variable in new data

type

The type of predicted value. Options are linear predictor "lp" (which is always 0), the risk score exp(lp) "risk" (which is always 1), the cumulative hazard "cumhaz", the survival probability "surv", or the expected number of events "expected" (-log(surv))

times

The times at which to perform predictions

...

Unused

Author

Alexander Breskin