[R] smooth non cumulative baseline hazard in Cox model

Prof Brian Ripley ripley at stats.ox.ac.uk
Sun Jul 4 22:23:10 CEST 2004

If you have a smooth cumulative hazard you can differentiate it to get a 
differentiable hazard (using smooth in its technical sense).



for possible approaches in S/R.  There are several, e.g. in packages 
muhaz, polspline, sm, locfit, ....  What you cannot have is

- The Cox proportional hazards approach
- A smooth baseline hazard

since the derivation of the partial likelihood assumes a non-smooth 
baseline hazard.  You can have proportional hazards and e.g. penalized 
log-likelihood, though.  As an approximation you can smooth the fitted 
baseline cumulative hazard (e.g. by package pspline) and ask for its 

On Sun, 4 Jul 2004, Mayeul KAUFFMANN wrote:

> Hi everyone.
> There's been several threads on baseline hazard in Cox model but I think
> they were all on cumulative baseline hazard,
> for instance
> http://tolstoy.newcastle.edu.au/R/help/01a/0464.html
> http://tolstoy.newcastle.edu.au/R/help/01a/0436.html
> "basehaz" in package survival seems to do a cumulative hazard.
> extract from the basehaz function:
>     sfit <- survfit(fit)
>     H <- -log(sfit$surv)
> Since sfit$surv is monotonic, H will be monotonic too, which makes me think
> it is a cumulative function. I think H(t) it is the "sum" ("integration") of
> lambda's from 0 to t (Am I right?)
> What I need might be lambda(t) or lambda(t)dt  (I do not know for sure),
> something involving the instantaneous baseline risk.
> But, for sure,  I 've seen elsewhere what I need.
> Specifically, here:
> http://econ.worldbank.org/files/13214_CivilPeace.pdf
> that is page 41 of HEGRE, Håvard; ELLINGSEN, Tanja; GATES, Scott; GLEDITSCH,
> Nils Petter (2001). "Toward a Democratic Civil Peace? Democracy, Political
> Change, and Civil War, 1816-1992". American Political Science Review, vol.
> 95, no 1.
> I'm doing the same job as Hegre et al. (studying civil wars) but with the
> counting process formulation of the Cox model. (I use intervals, my formula
> looks like Surv(start,stop,status)~  etc.).

Careful, that is left- and right- censored, not intervals.  Surv has a 
type= argument.

> Like Hegre and alii (who use the stata software) I would like to have a
> curve showing what is the (instantaneous) overall risk of civil war at a
> given time, taking away the effect of the covariates.
> For those who also use the SAS software (which I'm not, unfortunately), the
> job I need to be done seems to be done by the SMOOTH macro described in
> "Survival Analysis Using the SAS System: A Practical Guide" by Paul D.
> Allison (see below).
> There is a graph (output 5.22 "smoothes hazard functions for two financial
> aid groups") P. 170 of his book which shows another example (except I only
> need it for 1 group, at mean values)
> I hope I am clear enough. Thank you a lot for any help.
> (sorry for mistakes in English as I'm on non native English speaker)
> Univ. Pierre Mendes France
> Grenoble - France
> ------------

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

More information about the R-help mailing list