Solved – How to estimate baseline hazard function in Cox Model with R

cox-modelrsurvival

I need to estimate baseline hazard function $\lambda_0(t)$ in a time dependent Cox model

$\lambda(t) = \lambda_0(t) \exp(Z(t)'\beta)$

While I took Survival course, I remember that the direct derivative of cumulative hazard function ($\lambda_0(t) dt = d\Lambda_0(t)$) would not be a good estimator because Breslow estimator gives a step function.

So, is there any function in R that I could use directly ? Or any reference on this topic ?

I am not sure if it is worth to open another question, so I just add some background why baseline hazard function is important for me. The formula below estimates the probability that the survival time for one subject is larger than another,. Under a Cox model setting, baseline hazard function $\lambda_0(t)$ is required.

$P(T_1 > T_2 ) = – \int_0^\infty S_1(t) dS_2(t) = – \int_0^\infty S_1(t)S_2(t)\lambda_2(t)dt $

Best Answer

A Cox model was explicitly designed to be able to estimate the hazard ratios without having to estimate the baseline hazard function. This is a strength and a weakness. The strength is that you cannot make errors in functions you don't estimate. This is a real strength and is the reason why people refer to it as "semi-parametric" and is to a large extent responsible for its popularity. However, it is also a real weakness, in that once you want to know something other than the hazard ratio, you will often require the baseline hazard function and that defeats the very purpose of a Cox model.

So I tend to use Cox models only when I am interested in hazard ratios and nothing else. If I want to know other things, I typically move on to other models like the ones discussed here: http://www.stata.com/bookstore/flexible-parametric-survival-analysis-stata/