-
-
Notifications
You must be signed in to change notification settings - Fork 560
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
kmf.plot() last point extra line to zero #327
Comments
I'd expect red line to end at point (4990, 0.2), not at (4990, 0) |
@avkitex This is very interesting to me. I haven't been able to reproduce the error though. Here's my test data: T = np.arange(0, 50, 0.5)
E = np.random.binomial(1, 0.7, 100)
E[-1] = 0
kmf = KaplanMeierFitter()
kmf.fit(T, E) The survival curve at the last point is > 0. Are you able to send me your data for group |
Try this:
Green and blue line end censored. While red line ends with an event. This results in extra stretch down. |
Is your original post mistyped? Do you mean to say last point uncensored? |
R seems to agree with lifelines: it should hit 0 t <- c(10, 30, 40)
e <- c(0,1,1)
s = survfit(Surv(t, e) ~ 1)
summary(s)
|
Yes, I mistyped. I just wanted to point, that event at the middle of the curve cases small height decrease while the single last one (the last point if uncensored) cases many times more height decrease. I guess the issue could be closed. Thanks for conversation! |
thanks for the follow up ❤️ |
Last point censored could result in extra line from last value to zero (see red line on picture at ~5000 days)
The text was updated successfully, but these errors were encountered: