pchaz {nph}R 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,\dots,k with 0 = t_0 < t_1 \dots < t_k, the function assume constant hazards \lambda_{j} at each interval. The resulting hazard function is \lambda(t) =\sum_{j=1}^k \lambda_{j} {1}_{t \in [t_{j-1},t_j)}, the cumulative hazard function is\ \Lambda(t) = \int_0^t \lambda(s) ds =\sum_{j=1}^k \left( (t_j-t_{j-1})\lambda_{j} {1}_{t > t_j} + (t-t_{j-1}) \lambda_{j} {1}_{t \in [t_{j-1},t_j) } \right) and the survival function S(t) = e^{-\Lambda(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))

[Package nph version 2.1 Index]