profile
viewpoint

sean-reed/bdd-signatures 0

A Python 3 implementation of the algorithm for calculating the system and survival signature from a binary decision diagram representation of a system's reliability structure function.

sean-reed/dd 0

Binary Decision Diagrams (BDDs) in pure Python and Cython bindings to CUDD and BuDDy

sean-reed/lifelines 0

Survival analysis in Python

issue closedCamDavidsonPilon/lifelines

Kaplan-Meier plot_loglogs difference from docs

The docstring says this function gives a plot of log(S(t)) against log(t) but it actually produces a plot of log(-log(S(t))) (correctly labelled on y-axis) against t (incorrectly labelled as log(t)) with a linear-scaled y-axis and log-scaled x-axis.

I can submit a fix for this but, assuming the intention of this function is to produce a straight line plot for Weibull distributed survival times, there are various solutions:

(a) Plot -log(S(t)) against t, with log-scaled x and y axes. (b) Plot -log(S(t)) against log(t), with linear-scaled x-axis and log-scaled y-axis. (c) Plot log(-log(S(t)) against log(t), with linear-scaled x and y axes.

My suggestion is solution (b) as it's closest to the current function name and docstring.

closed time in 2 months

sean-reed

pull request commentCamDavidsonPilon/lifelines

Fixed plot_loglogs (issue #1033).

from lifelines.datasets import load_dd
from lifelines import KaplanMeierFitter

data = load_dd()
data.head()
kmf = KaplanMeierFitter()
T = data["duration"]
E = data["observed"]
kmf.fit(T, event_observed=E)
kmf.plot_loglogs()

plot1

Or with kmf.plot_loglogs(show_censors=True):

myplot1_censors

sean-reed

comment created time in 2 months

push eventsean-reed/lifelines

sean-reed

commit sha ed5d8e8957c726a543e6ea37bc218716e03852b0

Fix typo in kaplan_meier_fitter.py

view details

push time in 2 months

PR opened CamDavidsonPilon/lifelines

Fixed plot_loglogs (issue #1033).

Now plots log(-log(S)) against log(t) on linear axes.

+6 -5

0 comment

2 changed files

pr created time in 2 months

create barnchsean-reed/lifelines

branch : plot-loglogs

created branch time in 2 months

delete branch sean-reed/lifelines

delete branch : log-rank-alternatives

delete time in 2 months

pull request commentCamDavidsonPilon/lifelines

Added Wilcoxon, Tarone-Ware and Peto log-rank alternative tests

Added some docs and also the Fleming-Harrington test (https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6047314/#bib4) that allows testing for late differences in survival.

sean-reed

comment created time in 2 months

push eventsean-reed/lifelines

Sean Reed

commit sha 0891170b43bfa951225c3c5300185453ab60ac48

Added Fleming-Harrington logrank test and some documentation for weighted logrank tests to Examples.rst.

view details

push time in 2 months

pull request commentCamDavidsonPilon/lifelines

Added Wilcoxon, Tarone-Ware and Peto log-rank alternative tests

Thanks, leave it to me I'll add it.

sean-reed

comment created time in 2 months

issue commentCamDavidsonPilon/lifelines

Kaplan-Meier plot_loglogs difference from docs

Yes, sounds good to me.

sean-reed

comment created time in 2 months

issue commentCamDavidsonPilon/lifelines

Kaplan-Meier plot_loglogs difference from docs

On that second point, may also be useful to have the option to have the confidence intervals included in the plot? I don't think it's an option at the moment?

sean-reed

comment created time in 2 months

issue commentCamDavidsonPilon/lifelines

Kaplan-Meier plot_loglogs difference from docs

For checking proportional hazards I don't think it matters too much as the curves will be parallel either way if the assumption holds since it's just a different scaling of time. I think it's still useful to plot either log(t) on a linear axis or t on log axis (as it is now) though, as then Weibull distributed survival times should appear as an approximately straight line.

sean-reed

comment created time in 2 months

push eventsean-reed/lifelines

sean-reed

commit sha 8f189530456ab0fd39c6f2b28ad84d864eb5006a

Fix typos in Weibull fitter description.

view details

Cameron Davidson-Pilon

commit sha 6d0ff80ec23e81090f9f49c9acc0af3bd067c0ca

Merge pull request #1031 from sean-reed/patch-1 Fix typos in Weibull fitter description.

view details

Sean Reed

commit sha e172eea1125381097809b089f621517bc356d4be

Merge branch 'master' into log-rank-alternatives

view details

Sean Reed

commit sha 258be2c9e34f1706dc59c6454161e5f15f96c490

Updated option names for weighted log-rank tests.

view details

push time in 2 months

pull request commentCamDavidsonPilon/lifelines

Added Wilcoxon, Tarone-Ware and Peto log-rank alternative tests

The weighted tests put emphasis on the beginning of the survival curve (e.g. Wilcoxon where weight is based on remaining number at risk), increasing the power of the test when it's expected the difference in survival is early on, whereas the standard log-rank test has maximum power for proportional hazards. For example, certain drugs reduce death rates early on (e.g. first 10 years over 20 year follow up) but have less effect on the death rate for those that survive beyond a certain point (e.g. between years 10 and 20). Another example might be an online store testing whether including a discount voucher with a customer's order influences the time to them placing their next order. You might expect it to influence the rate of re-ordering for the first few weeks after receiving the voucher but have a diminishing influence later on, so a weighted test may be more appropriate. Should add that the choice of whether to weight the test should be made in advance to avoid introducing bias. I can add something to the docs on this at some point.

sean-reed

comment created time in 2 months

Pull request review commentCamDavidsonPilon/lifelines

Added Wilcoxon, Tarone-Ware and Peto log-rank alternative tests

 def multivariate_logrank_test(     t_0: float, optional (default=-1)         the period under observation, -1 for all time. +    weightings: str, optional+        apply a weighted logrank test: options are "w" for Wilcoxon (also known as Breslow), "tw"

Yes, that seems better.

sean-reed

comment created time in 2 months

issue openedCamDavidsonPilon/lifelines

Kaplan-Meier plot_loglogs difference from docs

The docstring says this function gives a plot of log(S(t)) against log(t) but it actually produces a plot of log(-log(S(t))) (correctly labelled on y-axis) against t (incorrectly labelled as log(t)) with a linear-scaled y-axis and log-scaled x-axis.

I can submit a fix for this but, assuming the intention of this function is to produce a straight line plot for Weibull distributed survival times, there are various solutions:

(a) Plot -log(S(t)) against t, with log-scaled x and y axes. (b) Plot -log(S(t)) against log(t), with linear-scaled x-axis and log-scaled y-axis. (c) Plot log(-log(S(t)) against log(t), with linear-scaled x and y axes.

My suggestion is solution (b) as it's closest to the current function name and docstring.

created time in 2 months

push eventsean-reed/lifelines

sean-reed

commit sha 8f189530456ab0fd39c6f2b28ad84d864eb5006a

Fix typos in Weibull fitter description.

view details

Cameron Davidson-Pilon

commit sha 6d0ff80ec23e81090f9f49c9acc0af3bd067c0ca

Merge pull request #1031 from sean-reed/patch-1 Fix typos in Weibull fitter description.

view details

push time in 2 months

push eventsean-reed/lifelines

sean-reed

commit sha 8f189530456ab0fd39c6f2b28ad84d864eb5006a

Fix typos in Weibull fitter description.

view details

push time in 2 months

delete branch sean-reed/lifelines

delete branch : wilcoxon

delete time in 2 months

create barnchsean-reed/lifelines

branch : log-rank-alternatives

created branch time in 2 months

push eventsean-reed/lifelines

Sean Reed

commit sha c0ba943adc4290f9d9b341c473db629993f8c3d2

Added plotting of lifetimes from interval censored data Added plot_interval_censored_lifetimes function - similar to plot_lifetimes but for interval censored data.

view details

Sean Reed

commit sha fff34db897ca2f544f3258fd91caf5db71627e17

Moved iloc to top level function.

view details

Sean Reed

commit sha 94e38fdd2082146fa3acb676b172d5e1165b834b

Merge branch 'master' into add-interval-plot

view details

Sean Reed

commit sha a368b003d46a3e3c2548021e91dba2fffbe3128b

Added plot_interval_censored_lifetimes to public objects

view details

Cameron Davidson-Pilon

commit sha 290d5833384a16c2ca76995f4c0f9514e15c807b

Merge pull request #1006 from sean-reed/add-interval-plot Added plotting of lifetimes from interval censored data

view details

CamDavidsonPilon

commit sha 027ffd71f30ed5b81dc5447737d798de3000f2ba

v0.24.6

view details

CamDavidsonPilon

commit sha 0959c432e0b758c66e23f0cd21f8f2785c96eaf6

v0.24.6

view details

CamDavidsonPilon

commit sha c16a3d9f112ab695388dcb276467da0def30d8d1

fix iloc

view details

CamDavidsonPilon

commit sha 4f762299ee1a2de53ca233441d61f702499099f4

wip

view details

CamDavidsonPilon

commit sha c8df258d307fc10492ba35e3856bbeceb8490d9b

adding docs for plot_interval_censored_lifetimes

view details

CamDavidsonPilon

commit sha 504498186e4aa66a10e02ebd26abd4979dd905bc

changelog

view details

Cameron Davidson-Pilon

commit sha 6c45a8fc1d346432c2a00f21283ed15954e0e849

Merge pull request #1008 from CamDavidsonPilon/v0.24.6 v0.24.6

view details

Spiros Denaxas

commit sha c95aa6df74ee955ddb08553c156fe5f0c926765e

Typo in parametric baseline estimation method for splines

view details

Cameron Davidson-Pilon

commit sha 7ccf194368e21dd673b8ca0a0c47044bee088eef

Merge pull request #1009 from spiros/patch-1 Typo in parametric baseline estimation method for splines

view details

CamDavidsonPilon

commit sha b33d1aa14559bc1d2f43ce21f46d6c6b68ca5dce

doc bug hunting

view details

CamDavidsonPilon

commit sha e994713efd517fd2d1d47de2ce497c5befd4f411

clean up survival regression docs

view details

CamDavidsonPilon

commit sha 948d31f29d009fcbea1e8754a0c74eec184a0081

wip - these time-v functions are confusing as heck

view details

CamDavidsonPilon

commit sha f7b82e2e02723b6e20c49fba4ea3ad8e2558a115

docs improvements

view details

CamDavidsonPilon

commit sha d1e121f2a10d9088ce2b24f098307d5050ddc403

more corrections

view details

CamDavidsonPilon

commit sha ed2b20097c13309eb626bcc3b4a488c55c935dcc

done?

view details

push time in 2 months

startedCamDavidsonPilon/lifelines

started time in 3 months

issue commentCamDavidsonPilon/lifelines

Log-rank test and Breslow (Generalized Wilcoxon)

Great, I will add the other log-rank test variants and the unit tests etc. soon.

yong27

comment created time in 3 months

issue commentCamDavidsonPilon/lifelines

Log-rank test and Breslow (Generalized Wilcoxon)

There are a few other popular variations on the log-rank test that could also be added such as Peto and Flemington-Harrington.

yong27

comment created time in 3 months

issue commentCamDavidsonPilon/lifelines

Log-rank test and Breslow (Generalized Wilcoxon)

I had a go at adding the Wilcoxon and Tarone-Ware test stats: https://github.com/sean-reed/lifelines/blob/bb93312c4462c5a808118a6f1b79ea76aab2a9f7/lifelines/statistics.py#L649

Not much to the implementation of the tests themselves since just a case of applying weightings in the numerator and covariance matrix computations within the existing log-rank statistic implementation - mostly a refactoring to avoid duplicated code between the test statsistics. I still need to add some unit tests but were correct on on a few test examples I tried...

yong27

comment created time in 3 months

create barnchsean-reed/lifelines

branch : wilcoxon

created branch time in 3 months

delete branch sean-reed/lifelines

delete branch : wilcoxon

delete time in 3 months

push eventsean-reed/lifelines

Sean Reed

commit sha bb93312c4462c5a808118a6f1b79ea76aab2a9f7

Added Wilcoxon and Tarone-Ware tests.

view details

Sean Reed

commit sha 488cafc8af48e7c694d9005514cf018095cb7fb0

Merge remote-tracking branch 'origin/wilcoxon' into wilcoxon # Conflicts: # lifelines/statistics.py

view details

push time in 3 months

create barnchsean-reed/lifelines

branch : wilcoxon

created branch time in 3 months

more