# Estimating expected lifetime from hazard ratio and estimated base hazard function

Apologies if this is a basic question, I am not very familiar with survival analysis ...

I have trained a gradient boosted Cox proportional hazards model in R, and have been able to obtain reasonable hazard function estimates from through the gbm package's basehaz.gbm function.

My goal though is to obtain expected lifetimes. How does one go about obtaining these estimates given an estimated base hazard function and hazard ratios? Would it be best to find a parametric fit to the hazard function (or survival function)? Is this usually handled by a discrete approximation using the estimated survival function (and how would one account for the part of the curve unable to be estimated past a certain time due to sparsity of data)?

I've tried both approaches but have not gotten good results, and the standard parametric survival functions don't seem to fit my estimated curve particularly well.

The estimation of life-expectancy in the presence of censored data necessarily requires assumptions on the unobserved part of the survival function. A parametric distribution can be used for extrapolation of observed and expected survival, but it is not easy to capture the shape of the unobserved survival function. A possible approach is to use relative survival (see for instance: Andersson et al. 2012)

If you wish to avoid data extrapolation, this can be done by evaluating survival percentiles. With a sufficient number of cases you can estimate the median survival, while with a proportion of cases below 50% lower percentiles can be estimated.

Survival percentiles can be calculated from the Kaplan-Meier estimator, which summarizes the observed survival. If you are interested in adjusted survival percentiles you may take a look at Laplace regression (see for instance Orsini et al. 2012).

As you surmised, if you have censored data, it's impossible to calculate the expected lifetime without imposing additional assumptions on the unobserved failure times. One popular option is to assume an exponential drop-off after the last non-censored data point -- but again, that's just an assumption. It doesn't come from the model, or the data.

For survival models, it's usually better to think in terms of median lifetime, because there's actually a meaningful answer to that contained in the estimated survival function.

A great technical resource for these kinds of questions is Klein & Moeschberger's "Survival Analysis": http://www.amazon.com/Survival-Analysis-Techniques-Truncated-Statistics/dp/038795399X

You may want to check out the work of Haybittle/Pollard who give a good formula for estimating using the Gompertz function:

Life Expectancy at age x = 1/k * ln((1+k/h(x)) - 1/2 (1+ h(x)/k)^-2) k = 0.09 for most modern populations and h(x) is the hazard function in the general population. If you want to see the expectancy in a different group (e.g. smokers), multiply the h(x) by your hazard ratio for that group (e.g., hazard ratio for smokers).

Haybittle JL. The use of the Gompertz function to relate changes in life expectancy to the standardized mortality ratio. Int J Epidemiol. 1998 Oct;27(5):885-9. doi: 10.1093/ije/27.5.885. PMID: 9839748.

Pollard JH. Fun with Gompertz. Genus. 1991 Jan-Jun;47(1-2):1-20. PMID: 12284816.