I need to estimate baseline hazard function λ0(t) in a time dependent Cox model

λ(t)=λ0(t)exp(Z(t)′β)

While I took Survival course, I remember that the direct derivative of cumulative hazard function (λ0(t)dt=dΛ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 λ0(t) is required.

P(T1>T2)=−∫∞0S1(t)dS2(t)=−∫∞0S1(t)S2(t)λ2(t)dt

**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/

**Attribution***Source : Link , Question Author : elong , Answer Author : Nick Cox*