Signature
S_j = S_prev * exp(-h_j * L_j); A_j = S_prev * (1 - exp(-h_j * L_j)) / h_j
| Inputs | Definition | Unit |
|---|---|---|
S_prev | Proportion of the starting cohort alive at the start of interval j, equal to S_j of the previous interval and 1 for the first interval | proportion of the starting cohort |
h_j | Hazard of death assumed constant within interval j, above zero | events per person-year |
L_j | Length of interval j, in the same time unit as h_j | years |
S_j | Proportion of the starting cohort alive at the end of interval j | proportion of the starting cohort |
|---|---|---|
A_j | Expected life-years lived during interval j per person entering the cohort at time zero | years |
Function
Survival and mean survival from a bathtub-shaped hazard
Maps a hazard that is high soon after a procedure, falls to a stable level and later rises with age to the survival curve and the mean survival that a health economic model needs. Survival at time t is the exponential of minus the cumulative hazard up to t, and mean survival is the area under the survival curve. The formulae below apply this to a piecewise-constant hazard schedule, to a constant hazard fitted to early follow-up, to a sum of two Weibull hazards and to an all-cause hazard built from background and excess components. Turning an interval hazard into a cycle transition probability uses the conversion already given on the Transition Probability page (HE-FM-TP-001), which is not repeated here.
Computational function
Computational function: survival and mean survival from a piecewise-constant bathtub hazard schedule
Takes a bathtub hazard schedule as a model usually holds it, a list of cut points in years and one hazard per interval, and returns survival at each cut point, the life-years lived in each interval and mean survival. It applies HE-FM-BTH-001 interval by interval, carrying survival forward, and closes the schedule with the open final interval of HE-FM-BTH-002. The inputs therefore differ from the formula's variables: the formula handles one interval at a time, while the function builds the interval lengths from the cut points and chains the results.
Inputs and outputs:
cuts: Cut points in years since the procedure, in increasing order; may be empty for a single constant hazard. Unit: years.;h: Hazards for each interval, one more than the number of cut points, the last applying for ever; required, all above zero. Unit: events per person-year.;S: Survival at each cut point. Unit: proportion of the starting cohort.;A: Life-years lived in each interval, the last for the open interval. Unit: years.;E_T: Mean survival, the sum ofA. Unit: years.Assumption: The hazard is constant within each interval and the final hazard holds for life. Mean survival is undiscounted, and time runs from the procedure for the whole cohort.
Worked example (Article bathtub schedule): Hazards of 0.40, 0.05, 0.08 and 0.20 per year with cut points at three months, five years and fifteen years give mean survival of about 10.58 years, as in the article's table.
cuts = (0.25, 5, 15); h = (0.40, 0.05, 0.08, 0.20); S = (0.904837, 0.713552, 0.320620); A = (0.237906, 3.825709, 4.911655, 1.603098); E_T = 10.578368Worked example (Post-peak hazard carried forward): Dropping the late rise and keeping 0.05 per year from three months onwards gives about 18.33 years, the article's comparison.
cuts = (0.25); h = (0.40, 0.05); S = (0.904837); A = (0.237906, 18.096748); E_T = 18.334655Worked example (Constant schedule returns the exponential mean): The same hazard of 0.20 either side of a cut at five years returns 1 divided by 0.20, a limiting case that checks the implementation.
cuts = (5); h = (0.20, 0.20); S = (0.367879); A = (3.160603, 1.839397); E_T = 5Excel:
=D2*EXP(-C2*(B2-A2))and=IF(B2="",D2/C2,D2*(1-EXP(-C2*(B2-A2)))/C2)With one interval per row from row 2, start in column A, end in column B (blank for the open interval), hazard in column C and survival at the start in column D (1 in D2, then D3 equal to E2 and so on), the first formula in column E returns survival at the end and the second in column F the life-years;=SUM(F2:F5)returns mean survival for four intervals.R:
piecewise_surv <- function(cuts, h) { L <- diff(c(0, cuts)); k <- seq_along(L); S <- exp(-cumsum(h[k] * L)); S0 <- c(1, S); A <- c(S0[k] * (1-exp(-h[k] * L)) / h[k], S0[length(S0)] / h[length(h)]); list(S = S, A = A, mean = sum(A)) }Returns a list with survival at the cut points, the life-years per interval and the mean;piecewise_surv(c(0.25, 5, 15), c(0.40, 0.05, 0.08, 0.20))$meangives 10.578368.Python:
def piecewise_surv(cuts, h): L = [b-a for a, b in zip([0]+cuts, cuts)]; S = [math.exp(-x) for x in itertools.accumulate(hj*Lj for hj, Lj in zip(h, L))]; S0 = [1]+S; A = [s*(1-math.exp(-hj*Lj))/hj for s, hj, Lj in zip(S0, h, L)]+[S0[-1]/h[-1]]; return S, A, sum(A)Uses the math and itertools modules and returns survival, life-years and the mean;piecewise_surv([0.25, 5, 15], [0.40, 0.05, 0.08, 0.20])[2]gives 10.578368.Test (Every member of the cohort dies once): Summed over all intervals including the open one, hazard times life-years equals 1. Expected result: TRUE. Excel check:
=ABS(SUMPRODUCT(C2:C5,F2:F5)-1)<1E-9Test (Constant schedule reproduces 1 divided by the hazard): With 0.20 either side of a cut at five years the mean is 5. Expected result: TRUE. Excel check:
=ABS((1-EXP(-0.2*5))/0.2+EXP(-0.2*5)/0.2-5)<1E-9Common error (Hazard times interval length used as the interval probability): Multiplying survival by 1 minus h_j L_j for each interval of the article's schedule leaves about 0.137 alive at fifteen years instead of 0.3206, because the long five-to-fifteen interval loses 0.8 of its entrants rather than about 0.551.
Source: Demiris N, Lunn D, Sharples LD. Survival extrapolation using the poly-Weibull model. Statistical Methods in Medical Research. 2015;24(2):287-301. Equation 2.2, survival as the exponential of minus the integrated hazard, and equation 2.6, mean survival as the area under the survivor function.
S_j = S_prev * exp(-h_j * L_j); A_j = S_prev * (1 - exp(-h_j * L_j)) / h_j; A_K = S_c / h_K; E_T = sum(A_j)
Try this function
Implementations
Excel
Interval survival and life-years under a piecewise bathtub hazard
With named cells SurvStart, Hazard and Length for one interval, the two formulas return survival at the end of the interval and the life-years lived in it. Copying them down a table of intervals, with each SurvStart equal to the previous row's survival at the end, gives the whole curve.
=SurvStart*EXP(-Hazard*Length); =SurvStart*(1-EXP(-Hazard*Length))/Hazard
Assumptions
Hazard constant between bathtub cut points
The hazard does not change within an interval and jumps only at the cut points. The cut points are fixed before the hazards are estimated, because cut points chosen by eye can be arbitrary and can change the results, and a jump at a cut point may look clinically implausible.
One clock from the procedure for every bathtub interval
Time is measured from the procedure for every member of the cohort, and S_prev carries forward the survival from all earlier intervals. If the late rise is driven by attained age, the cut points correspond to ages only for a cohort that shares one starting age.
Worked examples
First three months at a post-procedure hazard of 0.40
In the article's illustrative example the hazard is 0.40 per year for the first three months. The whole cohort enters the interval, 0.904837 survive to three months, and each person entering lives on average 0.237906 years in the interval, shown as 0.9048 and 0.2379 in the article's table.
S_prev = 1; h_j = 0.40; L_j = 0.25; S_j = 0.904837; A_j = 0.237906
Three months to five years at a stable hazard of 0.05
Starting from survival of 0.904837 at three months, a hazard of 0.05 per year over the next 4.75 years leaves 0.713552 alive at five years and adds 3.825707 life-years per person entering, the article's 0.7136 and 3.8257 at four decimals.
S_prev = 0.904837; h_j = 0.05; L_j = 4.75; S_j = 0.713552; A_j = 3.825707
Five to fifteen years at a rising hazard of 0.08
From survival of 0.713552 at five years, a hazard of 0.08 per year over ten years leaves 0.320620 alive at fifteen years and adds 4.911655 life-years, the article's 0.3206 and 4.9117.
S_prev = 0.713552; h_j = 0.08; L_j = 10; S_j = 0.320620; A_j = 4.911655
Common errors
Bathtub interval life-years taken as length times starting survival
Multiplying the interval length by survival at its start ignores the deaths during the interval. For three months to five years, 4.75 × 0.904837 = 4.297976 life-years against 3.825707, an overstatement of about 0.47 life-years in a single interval.
Hazard times interval length used as a bathtub interval probability
Treating h_j L_j as the probability of dying in the interval fails for long intervals or high hazards. From five to fifteen years, 0.08 × 10 = 0.8 would leave only a fifth of the survivors alive, whereas the exponential factor exp(-0.8) leaves about 0.4493. The conversion on the Transition Probability page (HE-FM-TP-001) applies.
Sources
Poly-Weibull paper giving survival and mean survival from a hazard
Demiris N, Lunn D, Sharples LD. Survival extrapolation using the poly-Weibull model. Statistical Methods in Medical Research. 2015;24(2):287-301. Equation 2.2, which gives the survivor function as the exponential of minus the integrated hazard, and equation 2.6, which gives mean survival as the area under the survivor function.
Piecewise constant hazard models in DSU TSD 14
Latimer N. NICE DSU Technical Support Document 14: Survival analysis for economic evaluations alongside clinical trials, extrapolation with patient-level data. Sheffield: Decision Support Unit, ScHARR, University of Sheffield; 2011, last updated March 2013. Section 2.7, which describes piecewise constant models in which exponential models are fitted to different time periods, each with a constant hazard, as a simple way to model a variable hazard.
Cut points and final segments of piecewise models in DSU TSD 21
Rutherford MJ, Lambert PC, Sweeting MJ, Pennington B, Crowther MJ, Abrams KR, Latimer NR. NICE DSU Technical Support Document 21: Flexible methods for survival analysis. Sheffield: Decision Support Unit, ScHARR, University of Sheffield; 2020 (updated March 2022). Section 3.5.3, which notes that cut points chosen by visual inspection may be arbitrary, that sudden changes in the hazard may look clinically implausible, and that the final segment used for extrapolation may rest on few patients.
Canonical Identity
Stable URI · Machine-readable · Resolvable · CC BY 4.0