-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible bug in Nelson-Aalen #50
Comments
I'm not familiar with the |
Unfortunately, I had trouble figuring out how to adapt the example above to
Do you have more experience with it? |
AFAIK there are two ways, one more manual than the other: library("survival")
df <- data.frame(time=1:5, status=1)
na1 <- basehaz(coxph(Surv(time, status) ~ 1, data=df))$hazard
surv <- survfit(Surv(time, status) ~ 1, data=df)
na2 <- cumsum(surv$n.event / surv$n.risk) They produce the same result, which matches your However, when using other data (specifically |
I noticed that NelsonAalen repeats the second to last value twice. I thought this was odd, so I compared it to R.
Julia
Result
R
Result
Version
The text was updated successfully, but these errors were encountered: