Skip to content
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

Doubly censored data in the Kaplan-Meier estimator documentation #8

Open
lisandrojim opened this issue Oct 7, 2022 · 2 comments
Open
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@lisandrojim
Copy link

Hello,

I am fitting a Kaplan-Meier estimator with doubly censored data. But I get an error. To reproduce the error use the example below.

from relife.nonparametric import KaplanMeier as KM
km = KM()
km.fit(time=np.array([1,2,3]),event=np.array([1,0,2]))

The error is:

  File ~/relife/nonparametric.py:54 in _estimate
    raise ValueError("event values must be in [0,1]")
ValueError: event values must be in [0,1]

But the documentation says that event 2 is used to flag an event as left-censored.

@tomguillon tomguillon added the documentation Improvements or additions to documentation label Oct 7, 2022
@tomguillon
Copy link
Collaborator

Thank you for your comments.
The Kaplan-Meier estimator cannot handle left censoring and right censoring. This is an error in the documentation that needs to be corrected. If you are interested in a non-parametric algorithm that takes into account all possible censorships, this is the Turnbull algorithm. It is planned to implement it in a future version.

@tomguillon tomguillon changed the title Doubly censored data does not work in the Kaplan-Meier estimator Doubly censored data in the Kaplan-Meier estimator documentation Oct 7, 2022
@21ch216 21ch216 self-assigned this Jan 22, 2025
@21ch216 21ch216 added the enhancement New feature or request label Jan 22, 2025
@21ch216
Copy link
Collaborator

21ch216 commented Jan 22, 2025

Turnbull estimator is added for a future release (refactoring branch merged very soon). I'll make sure that the documentation is more explicit and add more control on the data one user can pass to the fit method depending on the type of object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants