Re: [R] Error in basehaz function ?

From: Roland Rau <>
Date: Fri 19 Jan 2007 - 15:46:59 GMT


David Mas wrote:
> I believe that the way basehaz (in the survival package) compute the
> baseline hazard function is false.
> I come to question this function when it gives me hazard probabilities
> greater than 1.
> Looking at the code I think I've localised the error :
> hazard probability is computed as :
> H <- -log(surv)

Maybe the documentation is not clear enough about that, but what you obtain in the previous code line is not the "hazard probability" but the "Cumulative Hazard Rate".
The hazard rate is typically defined h(t)=f(t)/S(t) where f(t) is the density at time t and S(t) is the value of the survival function at time t. And please note that this is not a probability. The hazard can take on values larger than 1.

Besides the literature given in ?basehaz, I can recommend Klein, JP Moeschberger, ML. Survival Analysis: Techniques for Censored and Truncated Data. Springer 2003

Starting at page 27, the hazard function and the cumulative hazard are introduced.

Hope this helps,

        [[alternative HTML version deleted]] mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Sat Jan 20 02:51:44 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 19 Jan 2007 - 16:30:27 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.