hazard_sub: Hazard Function for Sub Population

View source: R/RcppExports.R

hazard_subR Documentation

Hazard Function for Sub Population

Description

Computes the hazard function of a piecewise exponential distribution for the biomarker negative sub population, such that the resulting survival function for the ITT population closely matches a given piecewise survival function.

Usage

hazard_sub(
  piecewiseSurvivalTime = 0L,
  hazard_itt = NA_real_,
  hazard_pos = NA_real_,
  p_pos = NA_real_
)

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_itt

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

hazard_pos

A scalar or numeric vector specifying the hazard(s) for the biomarker positive sub population based on a piecewise exponential distribution.

p_pos

A numeric value specifying the prevalence of the biomarker positive sub population.

Details

This function determines the hazard vector \lambda_{\text{neg}} for the piecewise exponential distribution of the biomarker negative sub population, so that the implied survival function for the ITT population closely matches the specified piecewise exponential distribution with hazard vector \lambda_{\text{itt}}.

Let p_{\text{pos}} be the prevalence of the biomarker positive sub population, then the survival function for the ITT population is given by

S_{\text{itt}}(t) = p_{\text{pos}} S_{\text{pos}}(t) + (1 - p_{\text{pos}}) S_{\text{neg}}(t)

where S_{\text{pos}}(t) and S_{\text{neg}}(t) are the survival functions for the biomarker positive and biomarker negative sub populations, respectively.

Matching is performed sequentially at the internal cutpoints u_2, ..., u_J and at the point u_J + \log(2)/\lambda_{\text{itt},J} for the final interval, as well as the percentile points at 10%, 20%, ..., 90%, and 95%, to solve for \lambda_{\text{neg},1}, \ldots, \lambda_{\text{neg},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 the biomarker negative sub population.

  • hazard_pos: A numeric vector representing the hazard rates for the piecewise exponential distribution of the biomarker positive sub population at the same time points as the biomarker negative sub population.

  • hazard_neg: A numeric vector representing the estimated hazard rates for the piecewise exponential distribution of the biomarker negative sub population.

  • p_pos: The prevalence of the biomarker positive sub population (as input).

Author(s)

Kaifeng Lu (kaifenglu@gmail.com)

Examples

u <- c(0, 1, 3, 4)
lambda_itt <- c(0.0151, 0.0403, 0.0501, 0.0558)
lambda_pos <- c(0.0115, 0.0302, 0.0351, 0.0404)
p_pos <- 0.3
hazard_sub(u, lambda_itt, lambda_pos, p_pos)


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