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

Documentation does not match code, possibly incorrect handling of logrank=[] #5

Closed
shusheer opened this issue Apr 23, 2022 · 2 comments

Comments

@shusheer
Copy link

Nice project - I got my data processed and plotted in less than an hour from google pointing me to this project.

Bug 1: The documentation seems to be a little out of date though. Specifically, kaplanmeier/kaplanmeier.py lines 185...191 show that CI lines should preferably text descriptions of the line type, and that this should not be None when we actually want to show them, whereas the code example (but not the actual plot) for CI lines sets this to None. The code example also stores the result as "result", but later refers to "out", which may confuse people when just running the code and expecting it to work.

Bug 2: The title for km.plot always appends the logrank p-value, which is not always desired. It appears that at kaplanmeier/kaplanmeier.py line 181 you may have intended the ability to disable this by setting logrank=[] - but in this case the whole plot would not be plotted. I wonder if you meant to use this to alter the title format string?

@erdogant
Copy link
Owner

erdogant commented Apr 25, 2022

I created a new update tackling these issues.
Sphinx pages are updated. Check out here.

update with: pip install -U kaplanmeier
Version should be >= 0.1.7

from kaplanmeier import kaplanmeier as km
df = km.example_data()
results = km.fit(df['time'], df['Died'], df['group'])

# Custom title
km.plot(results, title='Custom title text')

image

# Defaults
km.plot(results)
km.plot(results, title=None)

image

# No title
km.plot(results)
km.plot(results, title='')

image

@erdogant erdogant closed this as completed Jul 8, 2022
@shusheer
Copy link
Author

shusheer commented Jul 8, 2022

Nice work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants