predict.mult_stage_survfit: Predict and fitted method for mult_stage_survfit

View source: R/model_class.R

predict.mult_stage_survfitR Documentation

Predict and fitted method for mult_stage_survfit

Description

Predict and fitted method for mult_stage_survfit

Usage

## S3 method for class 'mult_stage_survfit'
predict(
  object,
  newdata = object$covariate.data,
  pred.prob.trunc = c(0, 1),
  conf.level = 0.95,
  ...
)

## S3 method for class 'mult_stage_survfit'
fitted(object, pred.prob.trunc = c(0, 1), ...)

Arguments

object

a "mult_stage_survfit" object

newdata

new data frame of covariates used for prediction. Default is the covariate.data stored in object

pred.prob.trunc

values at which to truncate predicted survival probabilities from each model in object. Must be a numeric vector with 2 numbers in [0,1]. Default is c(0,1).

conf.level

confidence level for confidence interval when using the SDR estimator to estimate a scalar estimand (rather than a function), i.e. a survival probability unconditional on covariates and possibly conditional on survival up to a visit time. Ignored otherwise. Default is 0.95.

...

further arguments passed to predict methods of the models in object

Value

a vector of predicted (conditional) survival probabilities. If no covariates are used, that is, interested in the survival probability marginalized over all covariates so that all individuals have the same prediction, then only outputs that one predicted survial probability.


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