You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,12 @@
1
1
### Changelogs
2
2
3
+
### 0.18.5
4
+
- added new plotting methods to parametric univariate models: `plot_survival_function`, `plot_hazard` and `plot_cumulative_hazard`. The last one is an alias for `plot`.
5
+
- added new properties to parametric univarite models: `confidence_interval_survival_function_`, `confidence_interval_hazard_`, `confidence_interval_cumulative_hazard_`. The last one is an alias for `confidence_interval_`.
6
+
- Fixed some overflow issues with `AalenJohansenFitter`'s variance calculations when using large datasets.
7
+
- Fixed an edgecase in `AalenJohansenFitter` that causing some datasets with to be jittered too often.
8
+
- Add a new kwarg to `AalenJohansenFitter`, `calculate_variance` that can be used to turn off variance calculations since this can take a long time for large datasets. Thanks @pzivich!
9
+
3
10
### 0.18.4
4
11
- fixed confidence intervals in cumulative hazards for parametric univarite models. They were previously
Copy file name to clipboardExpand all lines: docs/Survival analysis with lifelines.rst
+34-6Lines changed: 34 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -570,17 +570,45 @@ Similarly, there are other parametric models in *lifelines*. Generally, which pa
570
570
llf = LogLogisticFitter().fit(T, E, label='LogLogisticFitter')
571
571
pwf = PiecewiseExponentialFitter([40, 60]).fit(T, E, label='PiecewiseExponentialFitter')
572
572
573
-
wbf.plot(ax=axes[0][0])
574
-
exf.plot(ax=axes[0][1])
575
-
lnf.plot(ax=axes[0][2])
576
-
naf.plot(ax=axes[1][0])
577
-
llf.plot(ax=axes[1][1])
578
-
pwf.plot(ax=axes[1][2])
573
+
wbf.plot_cumulative_hazard(ax=axes[0][0])
574
+
exf.plot_cumulative_hazard(ax=axes[0][1])
575
+
lnf.plot_cumulative_hazard(ax=axes[0][2])
576
+
naf.plot_cumulative_hazard(ax=axes[1][0])
577
+
llf.plot_cumulative_hazard(ax=axes[1][1])
578
+
pwf.plot_cumulative_hazard(ax=axes[1][2])
579
579
580
580
.. image:: images/waltons_cumulative_hazard.png
581
581
582
582
*lifelines* can also be used to define your own parametic model. There is a tutorial on this available, see `Piecewise Exponential Models and Creating Custom Models`_.
583
583
584
+
Parametric models can also be used to create and plot the survival function, too. Below we compare the parametic models versus the non-parametric Kaplan-Meier estimate:
585
+
586
+
.. code:: python
587
+
588
+
from lifelines import KaplanMeierFitter
589
+
590
+
fig, axes = plt.subplots(2, 3, figsize=(9, 5))
591
+
592
+
T = data['T']
593
+
E = data['E']
594
+
595
+
kmf = KaplanMeierFitter().fit(T, E, label='KaplanMeierFitter')
596
+
wbf = WeibullFitter().fit(T, E, label='WeibullFitter')
597
+
exf = ExponentialFitter().fit(T, E, label='ExponentalFitter')
598
+
lnf = LogNormalFitter().fit(T, E, label='LogNormalFitter')
599
+
llf = LogLogisticFitter().fit(T, E, label='LogLogisticFitter')
600
+
pwf = PiecewiseExponentialFitter([40, 60]).fit(T, E, label='PiecewiseExponentialFitter')
0 commit comments