r descr_models("proportional_hazards", "survival")

Tuning Parameters

This model has no tuning parameters.

Translation from parsnip to the original package

r uses_extension("proportional_hazards", "survival", "censored regression")

library(censored)

proportional_hazards() %>% 
  set_engine("survival") %>% 
  set_mode("censored regression") %>% 
  translate()

Other details

The model does not fit an intercept.

The main interface for this model uses the formula method since the model specification typically involved the use of [survival::Surv()].

The model formula can include special terms, such as [survival::strata()]. The allows the baseline hazard to differ between groups contained in the function. The column used inside strata() is treated as qualitative no matter its type.

For example, in this model, the numeric column rx is used to estimate two different baseline hazards for each value of the column:

library(survival)

proportional_hazards() %>% 
  fit(Surv(futime, fustat) ~ age + strata(rx), data = ovarian) %>% 
  extract_fit_engine() %>% 
  # Two different hazards for each value of 'rx'
  basehaz()

Note that columns used in the strata() function will not be estimated in the regular portion of the model (i.e., within the linear predictor).


Linear predictor values


Case weights


References



Try the parsnip package in your browser

Any scripts or data that you put into this service are public.

parsnip documentation built on Aug. 18, 2023, 1:07 a.m.