knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

censored a pixelated version of the parsnip logo with a black censoring bar

R-CMD-check Codecov test coverage Lifecycle: experimental R-CMD-check-hard

censored is a parsnip extension package which provides engines for various models for censored regression and survival analysis.

Installation

You can install the released version of censored from CRAN with:

install.packages("censored")

And the development version from GitHub with:

# install.packages("pak")
pak::pak("tidymodels/censored")

Available models, engines, and prediction types

censored provides engines for the models in the following table. For examples, please see Fitting and Predicting with censored.

The time to event can be predicted with type = "time", the survival probability with type = "survival", the linear predictor with type = "linear_pred", the quantiles of the event time distribution with type = "quantile", and the hazard with type = "hazard".

library(censored)
library(dplyr)
library(purrr)
library(tidyr)

yep <- cli::symbol$tick
nope <- cli::symbol$cross

mod_names <- get_from_env("models")
model_info <-
  map_dfr(mod_names, ~ get_from_env(paste0(.x, "_predict")) %>% mutate(model = .x))

model_info %>%
  filter(mode == "censored regression") %>%
  select(model, engine, mode, type) %>%
  pivot_wider(
    names_from = type,
    values_from = mode,
    values_fill = nope,
    values_fn = function(x) yep
  ) %>%
  knitr::kable()

Contributing

This project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.



EmilHvitfeldt/survnip documentation built on April 23, 2024, 3:07 p.m.