[R] [newbie] Cox Baseline Hazard
Peter Dalgaard BSA
p.dalgaard at pubhealth.ku.dk
Fri Feb 23 00:13:17 CET 2001
Meles MELES <meles at free.fr> writes:
> And here is my first question.
> I'm actually trying to model a survival curve using a cox model.
> But I need the baseline cumulative hazard. I've been looking around on
> the web and the archives, and I found that it as to do with the
> nelson-aalen estimation.
> But I must not understand all the doc very well, because I can't get
> the baseline hazard.
> Could you help me, please.
survfit(coxph(...)) gives you the baseline survival function, which by
default (type="aalen") is calculated as S(t) = exp(-Lambda(t))
where Lambda(t) is the cumulative hazard. So all you have to do is to
reverse the formula as Lambda(t) = -log(S(t))
The estimated S(t) is in the $surv component of the object returned by
survfit().
e.g.
example(survfit)
s <- survfit(fit)
plot(c(0,s$time),c(0,-log(s$surv)),type='s')
--
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list