1

I am working with lifelines package in python which is for survival analysis. when I set different values on duration_col for censored events (the ones that have 0 on event_col), I get different results.

The fact is that censored events have no duration so theoretically it shouldn't change the result.

What should I set for the duration of censored values?

How does the algorithm consider the right censoring?

Kosar Kazemi
  • 65
  • 1
  • 6

1 Answers1

0

I'm the author of lifelines.

The fact is that censored events have no duration so theoretically it shouldn't change the result.

Censored events do have a duration¹. For example, I've been alive for 30 years, and I am still alive (that is, my death event is censored). So my life would have duration=30, event=0.

It might help to know what your application is for using survival analysis. Please let us know.

¹ I'm curious why you think censored events don't have a duration - was it unclear in some documentation you read?

Cam.Davidson.Pilon
  • 1,606
  • 1
  • 17
  • 31
  • Thank for your answer. actually, the reason I thought the censored events don't have a duration Is that I supposed the duration of study is similar for all the individuals and the duration input of the function is actually "Life Duration". Now it's clear though. About my application, actually my goal is to predict the time that a visitor comes back to a website. I'm using the CoxPHFitter since I want to consider other features of the visitor and the visit. – Kosar Kazemi Oct 10 '19 at 09:49
  • Another question I have is how to test the result in a proper way? With the **scikit-learn’s API**, there is a predict function but I don't know how to do the same thing without it. Something to get the closer time that the event will probably happen. – Kosar Kazemi Oct 10 '19 at 10:02
  • I would suggest looking at the docs here: https://lifelines.readthedocs.io/en/latest/Survival%20Regression.html#prediction and https://lifelines.readthedocs.io/en/latest/Compatibility%20with%20scikit-learn.html – Cam.Davidson.Pilon Oct 10 '19 at 12:37