hazard_pd: Hazard Function for Progressive Disease (PD) Given...

View source: R/RcppExports.R

hazard_pdR Documentation

Hazard Function for Progressive Disease (PD) Given Correlation Between PD and OS

Description

Computes the hazard function of a piecewise exponential distribution for progressive disease (PD), such that the resulting hazard function for progression-free survival (PFS) closely matches a given piecewise hazard for PFS.

Usage

hazard_pd(
  piecewiseSurvivalTime = 0L,
  hazard_pfs = NA_real_,
  hazard_os = NA_real_,
  rho_pd_os = 0.5
)

Arguments

piecewiseSurvivalTime

A vector that specifies the starting time of piecewise exponential survival time intervals. Must start with 0, e.g., c(0, 6) breaks the time axis into 2 event intervals: [0, 6) and [6, \infty). Defaults to 0 for exponential distribution.

hazard_pfs

A scalar or numeric vector specifying the hazard(s) for PFS based on a piecewise exponential distribution.

hazard_os

A scalar or numeric vector specifying the hazard(s) for overall survival (OS) based on a piecewise exponential distribution.

rho_pd_os

A numeric value specifying the correlation between PD and OS times.

Details

This function determines the hazard vector \lambda_{\text{pd}} for the piecewise exponential distribution of PD, so that the implied survival function for PFS time, T_{\text{pfs}} = \min(T_{\text{pd}}, T_{\text{os}}), closely matches the specified piecewise exponential distribution for PFS with hazard vector \lambda_{\text{pfs}}.

To achieve this, we simulate (Z_{\text{pd}}, Z_{\text{os}}) from a standard bivariate normal distribution with correlation \rho. Then, U_{\text{pd}} = \Phi(Z_{\text{pd}}) and U_{\text{os}} = \Phi(Z_{\text{os}}) are generated, where \Phi denotes the standard normal CDF.

The times to PD and OS are obtained via the inverse transform method using quantile functions of the piecewise exponential distribution:

T_{\text{pd}} = \text{qpwexp}(U_{\text{pd}},u,\lambda_{\text{pd}})

T_{\text{os}} = \text{qpwexp}(U_{\text{os}},u,\lambda_{\text{os}})

where u = piecewiseSurvivalTime.

The function solves for \lambda_{\text{pd}} such that the survival function of T_{\text{pfs}} closely matches that of a piecewise exponential distribution with hazard \lambda_{\text{pfs}}:

P(\min(T_{\text{pd}}, T_{\text{os}}) > t) = S_{\text{pfs}}(t)

Since

Z_{\text{pd}} = \Phi^{-1}(\text{ppwexp}(T_\text{pd}, u, \lambda_{\text{pd}}))

and

Z_{\text{os}} = \Phi^{-1}(\text{ppwexp}(T_\text{os}, u, \lambda_{\text{os}}))

we have

P(\min(T_{\text{pd}}, T_{\text{os}}) > t) = P(Z_{\text{pd}} > \Phi^{-1}(\text{ppwexp}(t,u,\lambda_{\text{pd}})), Z_{\text{os}} > \Phi^{-1}(\text{ppwexp}(t,u,\lambda_{\text{os}})))

while

S_{\text{pfs}}(t) = 1 - \text{ppwexp}(t,u,\lambda_{\text{pfs}})

Matching is performed sequentially at the internal cut points u_2, ..., u_J and at the point u_J + \log(2)/\lambda_{\text{pfs},J} for the final interval, as well as the percentile points at 10%, 20%, ..., 90%, and 95% to solve for \lambda_{\text{pd},1}, \ldots, \lambda_{\text{pd},K}, where K is the total number of unique cut points.

Value

A list with the following components:

  • piecewiseSurvivalTime: A vector that specifies the starting time points of the intervals for the piecewise exponential distribution for PD.

  • hazard_pd: A numeric vector representing the calculated hazard rates for the piecewise exponential distribution of PD.

  • hazard_os: A numeric vector representing the hazard rates for the piecewise exponential distribution of OS at the same time points as PD.

  • rho_pd_os: The correlation between PD and OS times (as input).

Author(s)

Kaifeng Lu (kaifenglu@gmail.com)

Examples

u <- c(0, 1, 3, 4)
lambda1 <- c(0.0151, 0.0403, 0.0501, 0.0558)
lambda2 <- 0.0145
rho_pd_os <- 0.5
hazard_pd(u, lambda1, lambda2, rho_pd_os)


lrstat documentation built on May 13, 2026, 9:06 a.m.