Calculate Median Survival Time from Piecewise Exponential Parameters
Source:R/getMediansurv.R
getMediansurv.Rd
This function calculates median survival time from time points and hazard rates using piecewise exponential survival function.
Details
The function assumes piecewise exponential survival with constant hazard within each interval. It calculates survival probabilities at each time point and finds the time where survival probability equals 0.5.
Mathematical formulation: $$S(t) = \exp\left(-\sum_{j=1}^{k} \lambda_j \cdot \Delta t_j\right)$$ where \(\lambda_j\) is hazard rate in interval j and \(\Delta t_j\) is the length of interval j up to time t.