fit.fun: Fit multiple survival models on survival data

View source: R/survival_functions.R

fit.funR Documentation

Fit multiple survival models on survival data

Description

fit.fun fits multiple survival models to survival data using survHE.

Usage

fit.fun(
  time,
  status,
  covariate = F,
  rx = NULL,
  data,
  extrapolate = FALSE,
  times,
  k = 2,
  legend_position = "bottom",
  xlow = min(times),
  xhigh = max(times),
  ylow = 0,
  yhigh = 1,
  risktable = F,
  mods = c("exp", "weibull", "gamma", "lnorm", "llogis", "gompertz", "rps", "gengamma")
)

Arguments

time

numeric vector of time to estimate probabilities.

status

numeric vector of event status.

covariate

logical value indicating whether treatment is being used as a covariate in parameteric survival models. Default = FALSE.

rx

character value indicating the treatment variable used as as covariate in parameteric survival models.

data

dataframe containing the time and status variables.

extrapolate

extrapolate beyond model time horizon. Default = FALSE.

times

time horizon the extrapolation is done over.

k

number of knots in Royston-Parmar spline model. Default = 2.

legend_position

position of the legend. Default = "bottom".

xlow

time horizon the extrapolation is done over. Default = min(time).

xhigh

time horizon the extrapolation is done over. Default = max(time).

ylow

time horizon the extrapolation is done over. Default = 0.

yhigh

time horizon the extrapolation is done over. Default = 1.

risktable

time horizon the extrapolation is done over. Default = F.

mods

a vector of models to fit. Choose from = c("exp", "weibull", "gamma", "lnorm", "llogis", "gompertz", "rps", "gengamma").

Value

a list containing all survival model objects.


DARTH-git/darthtools documentation built on April 3, 2025, 2:12 p.m.