50% off | Unlimited Data & AI Learning

Last chance! 50% off unlimited learning

Sale ends in


survex (version 1.2.0)

survival_to_cumulative_hazard: Transform Survival to Cumulative Hazard

Description

Helper function to transform between survival function and CHF

Usage

survival_to_cumulative_hazard(survival_functions, epsilon = 0)

Value

A matrix or vector transformed to the form of a cumulative hazard function.

Arguments

survival_functions

matrix or vector, with each row representing a survival function

epsilon

a positive numeric number to add, so that the logarithm can be taken

Examples

Run this code
library(survex)

vec <- c(1, 0.9, 0.8, 0.7, 0.6)
matr <- matrix(c(1, 0.9, 0.8, 1, 0.8, 0.6), ncol = 3)

survival_to_cumulative_hazard(vec)

survival_to_cumulative_hazard(matr)

Run the code above in your browser using DataLab