Learn R Programming

parsnip (version 0.1.6)

survival_reg: General Interface for Parametric Survival Models

Description

survival_reg() is a way to generate a specification of a model before fitting and allows the model to be created using R. The main argument for the model is:

  • dist: The probability distribution of the outcome.

This argument is converted to its specific names at the time that the model is fit. Other options and argument can be set using set_engine(). If left to its default here (NULL), the value is taken from the underlying model functions. If parameters need to be modified, update() can be used in lieu of recreating the object from scratch.

Usage

survival_reg(mode = "censored regression", dist = NULL)

Arguments

mode

A single character string for the type of model. The only possible value for this model is "censored regression".

dist

A character string for the outcome distribution. "weibull" is the default.

Details

The data given to the function are not saved and are only used to determine the mode of the model. For survival_reg(),the mode will always be "censored regression".

Since survival models typically involve censoring (and require the use of survival::Surv() objects), the fit() function will require that the survival model be specified via the formula interface.

See Also

fit(), survival::Surv(), set_engine(), update()

Examples

Run this code
# NOT RUN {
survival_reg()
# Parameters can be represented by a placeholder:
survival_reg(dist = varying())
# }

Run the code above in your browser using DataLab