Hi, I am taking a survival class. Recently I need to do the Nelson-Aalen estimtor in R. I searched through the R help manual and internet, but could not find such a R function. I tried another way by calculating the Kaplan-Meier estimator and take -log(S). However, the function only provides the summary of KM estimator but no estimated values. Could you please help me with this? I would highly appreciate your great help! Thanks, Tongtong ---------------------------------------------------------- IMPORTANT WARNING: This email (and any attachments) is only intended for the use of the person or entity to which it is addressed, and may contain information that is privileged and confidential. You, the recipient, are obligated to maintain it in a safe, secure and confidential manner. Unauthorized redisclosure or failure to maintain confidentiality may subject you to federal and state penalties. If you are not the intended recipient, please immediately notify us by return email, and delete this message from your computer.
On Tue, 5 Oct 2004, Wu, Tongtong wrote:> Hi, > > I am taking a survival class. Recently I need to do the Nelson-Aalen > estimtor in R. I searched through the R help manual and internet, but could > not find such a R function. I tried another way by calculating the > Kaplan-Meier estimator and take -log(S). However, the function only > provides the summary of KM estimator but no estimated values. Could you > please help me with this? I would highly appreciate your great help! >Taking -log(KM) does not give the Nelson-Aalen estimator, though it does give another consistent estimator of the cumulative hazard function. The easiest way to get the Nelson-Aalen estimator is basehaz(coxph(Surv(time,status)~1,data=aml)) because the (Breslow) hazard estimator for a Cox model reduces to the Nelson-Aalen estimator when there are no covariates. You can also compute it from information returned by survfit().> fit <- survfit(Surv(time, status) ~ 1, data = aml) > str(fit)List of 12 $ n : int 23 $ time : num [1:18] 5 8 9 12 13 16 18 23 27 28 ... $ n.risk : num [1:18] 23 21 19 18 17 15 14 13 11 10 ... $ n.event : num [1:18] 2 2 1 1 1 0 1 2 1 0 ... $ surv : num [1:18] 0.913 0.826 0.783 0.739 0.696 ... $ type : chr "right" $ std.err : num [1:18] 0.0643 0.0957 0.1099 0.1239 0.1379 ... $ upper : num [1:18] 1.000 0.996 0.971 0.942 0.912 ... $ lower : num [1:18] 0.805 0.685 0.631 0.580 0.531 ... $ conf.type: chr "log" $ conf.int : num 0.95 $ call : language survfit(formula = Surv(time, status) ~ 1, data = aml) - attr(*, "class")= chr "survfit" so cumsum(fit$n.event/fit$n.risk) is the Nelson-Aalen estimator for the times given by fit$times. If you want -log(S), then -log(fit$surv) will give it to you. -thomas
"Wu, Tongtong" <TTWu at mednet.ucla.edu> writes:> I am taking a survival class. Recently I need to do the Nelson-Aalen > estimtor in R. I searched through the R help manual and internet, but could > not find such a R function. I tried another way by calculating the > Kaplan-Meier estimator and take -log(S). However, the function only > provides the summary of KM estimator but no estimated values. Could you > please help me with this? I would highly appreciate your great help!It's the log of the Fleming-Harrington estimator that equals Nelson-Aalen. However, the main thing is that the survival package is peculiar in that it does such transformations as part of plot.survfit(). If you want the actual values of the N-A estimator, I don't think there's any other way besides extracting the survival curve values from the survfit object and taking logs. So: you should study the help pages for plot.survfit and survfit.object. -- 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
Possibly Parallel Threads
- Nelson-Aalen estimator of cumulative hazard
- estimating the proportion without recurring ailment based on the nelson-aalen estimator
- Nelson-Aalen Estimator in R: Error Message
- Nelson-Aalen Estimator in R: Error Message
- breslow estimator for cumulative hazard function