pop_pchaz {nph} | R Documentation |
Calculate survival for piecewise constant hazards with change after random time and mixture of subpopulations
Description
Calculates hazard, cumulative hazard, survival and distribution function based on hazards that are constant over pre-specified time-intervals
Usage
pop_pchaz(
Tint,
lambdaMat1,
lambdaMat2,
lambdaProgMat,
p,
timezero = FALSE,
int_control = list(rel.tol = .Machine$double.eps^0.4, abs.tol = 1e-09),
discrete_approximation = FALSE
)
Arguments
Tint |
vector of length |
lambdaMat1 |
matrix of dimension |
lambdaMat2 |
matrix of dimension |
lambdaProgMat |
matrix of dimension |
p |
vector of length |
timezero |
logical, indicating whether after the changing event the timecount, governing which interval in |
int_control |
A list with additional paramaters to be passed to the |
discrete_approximation |
if TRUE, the function uses an approximation based on discretizing the time, instead of integrating. This speeds up the calculations |
Details
Given m
subgroups with relative sizes p_1, \dots, p_m
and
subgroup-specific survival functions S{l}(t)
,
the marginal survival function is the mixture S(t)=\sum_{l=1}^m p_l S_{l}(t)
.
Note that the respective hazard function is not a linear combination of the
subgroup-specific hazard functions.
It may be calculated by the general relation \lambda(t)=-\frac{dS(t)}{dt}\frac{1}{S(t)}
.
In each subgroup, the hazard is modelled as a piecewise constant hazard, with
the possibility to also model disease progression.
Therefore, each row of the hazard rates is used in subpop_pchaz
.
See pchaz
and subpop_pchaz
for more details.
The output includes the function values calculated for all integer time points
between 0 and the maximum of Tint
.
Note: this function may be very slow in cases where many time points need to be calculated. If this happens, use
discrete_approximation = TRUE
.
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.
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
pchaz
, subpop_pchaz
, plot.mixpch
Examples
pop_pchaz(Tint = c(0, 40, 100),
lambdaMat1 = matrix(c(0.2, 0.1, 0.4, 0.1), 2, 2),
lambdaMat2 = matrix(c(0.5, 0.2, 0.6, 0.2), 2, 2),
lambdaProg = matrix(c(0.5, 0.5, 0.4, 0.4), 2, 2),
p = c(0.8, 0.2),
timezero = FALSE, discrete_approximation = TRUE)