mult_stage_survfit: S3 class for the predictive model for (conditional) survival...

View source: R/model_class.R

mult_stage_survfitR Documentation

S3 class for the predictive model for (conditional) survival probability with multiple stages

Description

This function is the creator of mult_stage_survfit class. A mult_stage_survfit object is a collection of fitted models for conditional survival probability within each time window. The associated predict and fitted methods autocmatically conduct the prediction, which is multiplying all model predictions, potentially after clipping the predictions into an interval in [0,1].

Usage

mult_stage_survfit(
  covariate.data,
  formula,
  visit.times,
  tval,
  truncation.index,
  models
)

Arguments

covariate.data

data frame containing the covariates used to train the models

formula

formula used in the models

visit.times

numeric/integer vector of visit times in ascending order. The first visit time is typically the baseline.

truncation.index

index of the visit time to which left-truncation is applied. The truncation time is visit.times[truncation.index]. Covariates available up to (inclusive) visit.times[truncation.index] are of interest.

models

list of models. Each model can predict the survival probability beyond the next visit time given survival at the current visit time. Models should be in an ascending order according to the corresponding visit times.

tvals

time t for which P(T > t) (potentially given covariates) is estimated (T is the time to event)

Value

a "mult_stage_survfit" object, essentially a list with input parameters of this function.


QIU-Hongxiang-David/SDRsurv documentation built on March 29, 2024, 8:41 a.m.