Package 'censored'

Title: 'parsnip' Engines for Survival Models
Description: Engines for survival models from the 'parsnip' package. These include parametric models (e.g., Jackson (2016) <doi:10.18637/jss.v070.i08>), semi-parametric (e.g., Simon et al (2011) <doi:10.18637/jss.v039.i05>), and tree-based models (e.g., Buehlmann and Hothorn (2007) <doi:10.1214/07-STS242>).
Authors: Emil Hvitfeldt [aut] , Hannah Frick [aut, cre] , Posit Software, PBC [cph, fnd]
Maintainer: Hannah Frick <[email protected]>
License: MIT + file LICENSE
Version: 0.3.2.9000
Built: 2024-11-03 07:00:37 UTC
Source: https://github.com/tidymodels/censored

Help Index


censored: parsnip Engines for Survival Models

Description

censored provides engines for survival models from the parsnip package. The models include parametric survival models, proportional hazards models, decision trees, boosted trees, bagged trees, and random forests. See the "Fitting and Predicting with censored" article for various examples. See below for examples of classic survival models and how to fit them with censored.

Author(s)

Maintainer: Hannah Frick [email protected] (ORCID)

Authors:

Other contributors:

  • Posit Software, PBC [copyright holder, funder]

See Also

Useful links:

Examples

# Accelerated Failure Time (AFT) model

fit_aft <- survival_reg(dist = "weibull") %>%
  set_engine("survival") %>%
  fit(Surv(time, status) ~ age + sex + ph.karno, data = lung)
predict(fit_aft, lung[1:3, ], type = "time")


# Cox's Proportional Hazards model

fit_cox <- proportional_hazards() %>%
  set_engine("survival") %>%
  fit(Surv(time, status) ~ age + sex + ph.karno, data = lung)
predict(fit_cox, lung[1:3, ], type = "time")


# Andersen-Gill model for recurring events

fit_ag <- proportional_hazards() %>%
  set_engine("survival") %>%
  fit(Surv(tstart, tstop, status) ~ treat + inherit + age + strata(hos.cat),
    data = cgd
  )
predict(fit_ag, cgd[1:3, ], type = "time")

Number of days before a movie grosses $1M USD

Description

These data are a somewhat biased random sample of 551 movies released between 2015 and 2018. Columns include

Details

  • title: a character string for the movie title.

  • time: number of days until the movie earns a million US dollars.

  • event: a binary value for whether the movie reached this goal. About 94% of the movies had observed events.

  • released: a date field for the release date.

  • distributor: a factor with the the name of the distributor.

  • released_theaters: the maximum number of theaters where the movie played in the first two weeks of release.

  • year: the release year.

  • rated: a factor for the Motion Picture Association film rating.

  • runtime: the length of the movie (in minutes).

  • A set of indicators columns for the movie genre (e.g. action, crime, etc.).

  • A set of indicators for the language (e.g., english, hindi, etc.).

  • A set of indicators for countries where the movie was released (e.g., uk, japan, etc.)

Value

time_to_million

a tibble