lifelines icon indicating copy to clipboard operation
lifelines copied to clipboard

Modeling late entries in CPH

Open ah-sadek opened this issue 5 years ago • 2 comments

When modeling late entries in a kmf, the survival function would be more 'pessimistic' about customer survival, which makes sense.

kmf.fit(data["Duration"], event_observed=data["Observed"], entry=data["W"], label='modeling late entries') image

However, when modeling late entries in a cph, we see the opposite effect, being, getting a better survival function than when ignoring late entries.

cph.fit(data, 'Duration', 'Observed',entry_col='W') image

You can also refer to my repo here: https://github.com/ah-sadek/CustomerAnalytics

ah-sadek avatar Nov 24 '20 22:11 ah-sadek

It is worthy to note that you mentioned that there is a bug when calculating the survival function in the Cox model with late entries. Specifically, while the coefficient estimate calculations handle the late entries, the calculation of the survival function does not.

ah-sadek avatar Nov 24 '20 22:11 ah-sadek

Thanks @ah-sadek!

CamDavidsonPilon avatar Nov 25 '20 02:11 CamDavidsonPilon