pchaz: Calculate survival for piecewise constant hazard

View source: R/continuous_functions_1-1.R

pchazR Documentation

Calculate survival for piecewise constant hazard

Description

Calculates hazard, cumulative hazard, survival and distribution function based on hazards that are constant over pre-specified time-intervals.

Usage

pchaz(Tint, lambda)

Arguments

Tint

vector of length k+1, for the boundaries of k time intervals (presumably in days) with piecewise constant hazard. The boundaries should be increasing and the first one should be 0, the last one should be larger than the assumed trial duration.

lambda

vector of length k with the piecewise constant hazards for the intervals specified via Tint.

Details

Given k time intervals [t_{j-1},t_j), j=1,…,k with 0 = t_0 < t_1 … < t_k, the function assume constant hazards λ_{j} at each interval. The resulting hazard function is λ(t) =∑_{j=1}^k λ_{j} {1}_{t \in [t_{j-1},t_j)}, the cumulative hazard function is\ Λ(t) = \int_0^t λ(s) ds =∑_{j=1}^k ≤ft( (t_j-t_{j-1})λ_{j} {1}_{t > t_j} + (t-t_{j-1}) λ_{j} {1}_{t \in [t_{j-1},t_j) } \right) and the survival function S(t) = e^{-Λ(t)}. The output includes the functions values calculated for all integer time points between 0 and the maximum of Tint. Additionally, a list with functions is also given to calculate the values at any arbitrary point t.

Value

A list with class mixpch containing the following components:

haz

Values of the hazard function over discrete times t.

cumhaz

Values of the cumulative hazard function over discrete times t.

S

Values of the survival function over discrete times t.

F

Values of the distribution function over discrete times t.

t

Time points for which the values of the different functions are calculated.

Tint

Input vector of boundaries of time intervals.

lambda

Input vector of piecewise constant hazards.

funs

A list with functions to calculate the hazard, cumulative hazard, survival, pdf and cdf over arbitrary continuous times.

Author(s)

Robin Ristl, robin.ristl@meduniwien.ac.at, Nicolas Ballarini

References

Robin Ristl, Nicolas Ballarini, Heiko Götte, Armin Schüler, Martin Posch, Franz König. Delayed treatment effects, treatment switching and heterogeneous patient populations: How to design and analyze RCTs in oncology. Pharmaceutical statistics. 2021; 20(1):129-145.

See Also

subpop_pchaz, pop_pchaz, plot.mixpch

Examples

pchaz(Tint = c(0, 40, 100), lambda=c(.02, .05))

nph documentation built on May 17, 2022, 1:06 a.m.