subpop_pchaz {nph} | R Documentation |
Calculate survival for piecewise constant hazards with change after random time
Description
Calculates hazard, cumulative hazard, survival and distribution function based on hazards that are constant over pre-specified time-intervals
Usage
subpop_pchaz(
Tint,
lambda1,
lambda2,
lambdaProg,
timezero = FALSE,
int_control = list(rel.tol = .Machine$double.eps^0.4, abs.tol = 1e-09),
discrete_approximation = FALSE
)
Arguments
Tint |
vector of length |
lambda1 |
vector of length |
lambda2 |
vector of length |
lambdaProg |
vector of length |
timezero |
logical, indicating whether after the changeing event the timecount, governing which interval in |
int_control |
A list with the |
discrete_approximation |
if TRUE, the function uses an approximation based on discretizing the time, instead of integrating. This speeds up the calculations |
Details
We assume that the time to disease progression T_{PD}
is governed
by a separate process with hazard function \eta(t)
,
which does not depend on the hazard function for death \lambda(t)
.
\eta(t)
, too, may be modelled as piecewise constant or, for simplicity,
as constant over time. We define \lambda_{prePD}(t)
and \lambda_{postPD}(t)
as the hazard functions for death before and after disease progression.
Conditional on T_{PD}=s
, the hazard function for death is
\lambda(t|T_{PD}=s)=\lambda_{prePD}(t){I}_{t\leq s}+\lambda_{postPD}(t){I}_{t>s}
.
The conditional survival function is
S(t|T_{PD}=s)=\exp(-\int_0^t \lambda(t|T_{PD}=s)ds)
.
The unconditional survival function results from integration over all
possible progression times as S(t)=\int_0^t S(t|T_{PD}=s)dP(T_{PD}=s)
.
The output includes the function 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.
cumhaz
Values of the cumulative hazard function.
S
Values of the survival function.
F
Values of the distribution function.
t
Time points for which the values of the different functions are calculated.
Tint
Input vector of boundaries of time intervals.
lambda1
Input vector of piecewise constant hazards before the changing event happen.
lambda2
Input vector of piecewise constant hazards after the changing event happen.
lambdaProg
Input vector of piecewise constant hazards for the changing event.
funs
A list with functions to calculate the hazard, cumulative hazard, survival, 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
Examples
subpop_pchaz(Tint = c(0, 40, 100), lambda1 = c(0.2, 0.4), lambda2 = c(0.1, 0.01),
lambdaProg = c(0.5, 0.4),timezero = FALSE, discrete_approximation = TRUE)
subpop_pchaz(Tint = c(0, 40, 100), lambda1 = c(0.2, 0.4), lambda2 = c(0.1, 0.01),
lambdaProg = c(0.5, 0.4), timezero = TRUE, discrete_approximation = TRUE)