proportional_hazards: Parsnip engines for Proportional Hazards Models...

Description Details Engine Details Examples

These arguments are converted to their specific names at the time that the model is fit. Other options and arguments can be set using set_engine(). If left to their defaults here (NULL), the values are taken from the underlying model functions. If parameters need to be modified, update() can be used in lieu of recreating the object from scratch.

Description

Parsnip engines for Proportional Hazards Models

proportional_hazards() is a way to generate a specification of a model before fitting and allows the model to be created using different packages in R. The main arguments for the model are:

These arguments are converted to their specific names at the time that the model is fit. Other options and arguments can be set using set_engine(). If left to their defaults here (NULL), the values are taken from the underlying model functions. If parameters need to be modified, update() can be used in lieu of recreating the object from scratch.

Details

Proportional hazards models include the Cox model. For proportional_hazards(), the mode will always be "censored regression".

The model can be created using the fit() function using the following engines:

Engine Details

Engines may have pre-set default arguments when executing the model fit call. For this type of model, the template of the fit calls are:

survival engine

1
survival::coxph(formula = missing_arg())

Note that, for linear predictor prediction types, the results are formatted for all models such that the prediction increases with time. For the proportional hazards model, the sign is reversed.

Examples

1
2
3
4
5
6
7
8
parsnip::show_engines("proportional_hazards")

library(survival)

cox_mod <-
  proportional_hazards() %>%
  set_engine("survival") %>%
  fit(Surv(time, status) ~ x, data = aml)

EmilHvitfeldt/survnip documentation built on April 8, 2021, 3:52 a.m.