'Kaplan meier calculation with alive, died and censor in python
I have data of years and how many survived, died and censor (withdraw) each year. Sample data is given below. It shows year, status, and total individuals in that year in status.
{(1, 'died'): 3,
(2, 'died'): 11,
(3, 'died'): 7,
(3, 'withdrew'): 2,
(4, 'died'): 4,
(4, 'withdrew'): 4,
(4, 'live'): 6,
(5, 'died'): 6,
(5, 'withdrew'): 1,
(6, 'died'): 2,
(6, 'live'): 7,
(6, 'withdrew'): 11,
(7, 'died'): 5,
(8, 'died'): 1,
(8, 'withdrew'): 2,
(8, 'live'): 8,
(9, 'died'): 7,
(9, 'withdrew'): 2,
(10, 'died'): 6,
(10, 'withdrew'): 7,
(10, 'live'): 5,
I checked KaplanMeierFitter from lifelines python library but it accept only True (died) and False (alive) as status. How can i pass censor information, where the patient stop followup
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|