View source: R/continuous_functions_1-1.R
| pchaz | R Documentation |
Calculates hazard, cumulative hazard, survival and distribution function based on hazards that are constant over pre-specified time-intervals.
pchaz(Tint, lambda)
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 |
lambda |
vector of length k with the piecewise constant hazards for the intervals specified via |
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.
A list with class mixpch containing the following components:
hazValues of the hazard function over discrete times t.
cumhazValues of the cumulative hazard function over discrete times t.
SValues of the survival function over discrete times t.
FValues of the distribution function over discrete times t.
tTime points for which the values of the different functions are calculated.
TintInput vector of boundaries of time intervals.
lambdaInput vector of piecewise constant hazards.
funsA list with functions to calculate the hazard, cumulative hazard, survival, pdf and cdf over arbitrary continuous times.
Robin Ristl, robin.ristl@meduniwien.ac.at, Nicolas Ballarini
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.
subpop_pchaz, pop_pchaz, plot.mixpch
pchaz(Tint = c(0, 40, 100), lambda=c(.02, .05))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.