Open user799595 opened 2 months ago
This is an interesting issue, and I want to agree with your expected
case. However, I'm also inclined to reject the case birth_time==death_time
as pathological to lifelines. Based on that highlighted comment, it sounds like birth_times is actually birth_time + \epsilon
. So if you want a true birth_time==death_time
, you would add an epsilon to the death time:
kmf = lifelines.KaplanMeierFitter()
kmf.fit([1+1e-10, 2], event_observed=[1, 0], entry=[1, 0])
print(kmf.survival_function_)
KM_estimate
timeline
0.0 1.0
1.0 1.0
1.0 0.5
2.0 0.5
This is terrible and not at all how I expect users to fix this. I'll have to think more about this.
Expected:
Actual:
I've read https://github.com/CamDavidsonPilon/lifelines/issues/497 and the corresponding comments
But I can't wrap my head around what this is saying. How could entrants not happen prior to deaths? If I have an observation with
birth_time==death_time
does that mean that it died before it was born?I thought that the likelihood is