Functions & Formulae

Each applied formula has its own function page, with a signature, implementations, and tests.

Cumulative hazard function linking the hazard, survival and cycle probabilities

H(t) = integral_0^t h(u) du; S(t) = exp(-H(t)); p(t) = 1 - exp(-(H(t) - H(t - Delta)))

Maps a hazard function over follow-up to its running total from the time origin, the cumulative hazard H(t). Survival is the exponential of minus H(t), so H(t) can be read off a survival curve and turned back into survival, and the rise in H(t) across a model cycle gives the probability of the event in that cycle for people event free at its start. On the log scale a Weibull cumulative hazard is a straight line in log time, which is the basis of the log-cumulative hazard plot. The notation follows the Cumulative Hazard article.

  • Cumulative hazard from a survival probability

    H_t = -log(S_t); F_t = 1 - S_t

    Takes minus the natural logarithm of the probability of being event free beyond time t, which gives the cumulative hazard at t, and sets it beside the probability of having had the event by t. The two agree only when both are small: the cumulative hazard has no upper limit and passes 1 when survival falls below exp(minus 1), about 0.3679, while the event probability never exceeds 1. The reverse step is S_t = exp(minus H_t).

  • Cycle transition probability from the rise in cumulative hazard across a cycle

    p_t = 1 - exp(-(H_t - H_prev))

    Gives the probability that a person event free at the start of a model cycle has the event by its end, from the cumulative hazard at the end of the cycle and at its start. Because survival is exp(minus H), the ratio S(t) / S(t minus Delta) is exp of minus the rise in H, so the conversion is exact for any hazard shape and the cohort trace reproduces the fitted curve. Time t runs from the origin of the fitted curve, so in a cohort model it is the time since model start at the cycle's end. With a constant hazard it reduces to HE-FM-TP-001.

  • Weibull cumulative hazard and its straight line on the log-cumulative hazard scale

    H_t = lambda * t^gamma; logH = log(lambda) + gamma * log(t)

    Gives the cumulative hazard of a Weibull curve written as S(t) = exp(minus lambda t^gamma), and its natural logarithm, which is a straight line in log time with intercept log(lambda) and gradient gamma. A gradient of 1 is the exponential model with a constant hazard, above 1 a rising hazard and below 1 a falling hazard. Under proportional hazards two arms' lines are parallel, separated by the log hazard ratio. This is the scale of the log-cumulative hazard plot that TSD 14 uses as its first step in choosing survival curves.