Learn R Programming

easysurv (version 2.0.1)

predict.fit_models: Predict method for fit_models

Description

Predict method for fit_models

Usage

# S3 method for fit_models
predict(object, eval_time = NULL, type = c("survival", "hazard"), ...)

Value

A list of predictions for each model in the fit_models object.

Arguments

object

An object of class fit_models

eval_time

(Optional) A vector of evaluation time points for generating predictions. Default is NULL, which if left as NULL, generates a sequence from 0 to 5 times the maximum observed time.

type

A character vector indicating the type of predictions to generate. Default is c("survival", "hazard").

...

Additional arguments

Examples

Run this code
models <- fit_models(
  data = easysurv::easy_bc,
  time = "recyrs",
  event = "censrec",
  predict_by = "group",
  covariates = "group"
)

predict(models)

Run the code above in your browser using DataLab