Functions & Formulae

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

Accelerated failure time function

log(T) = beta_0 + beta_1 * x + sigma * epsilon

Models the logarithm of the time to an event as a linear function of covariates plus a scaled error term whose distribution defines the model, such as Weibull, log-logistic or log-normal. A covariate multiplies time itself, so the survival curve of the treated group is the reference curve stretched or shrunk along the time axis: S(t|x = 1) equals S_0(t / TR), where TR is the time ratio.

  • Treated survival time at the same survival proportion

    t_T = TR * t_C

    Multiplies the time by which a given proportion of the reference group has had the event by the time ratio to give the corresponding time in the treated group. Applied at the median it gives the treated median; applied at every percentile it traces the whole treated curve.

  • Weibull hazard ratio implied by an accelerated failure time fit

    HR = exp(-beta_1 / sigma)

    For the Weibull distribution, the only one that is both a proportional hazards and an accelerated failure time model, converts the treatment coefficient and the scale parameter sigma of the log-linear form into the hazard ratio. The Weibull shape parameter equals 1 divided by sigma, so the same result is TR raised to the power minus 1 divided by sigma.