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 · 1 comment
Open
Labels
documentation Improvements or additions to documentation

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
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
Projects
None yet
Development

No branches or pull requests

2 participants