CamDavidsonPilon / lifelines

Survival analysis in Python
lifelines.readthedocs.org
MIT License
2.37k stars 560 forks source link

Cumulative Incidence Functions for competing risks #539

Open robdmc opened 5 years ago

robdmc commented 5 years ago

Hello.

What are your thoughts on adding support for cumulative incidence functions in lifelines. I am relatively new to survival analysis, but my current use case involves analyzing "deaths" from competing risks. There may be a better way of handling competing risks, but I thought I would ping you for your thoughts.

See, for instance. http://data.princeton.edu/pop509/cumulativeIncidence.pdf

pzivich commented 5 years ago

I have the Aalen-Johansen estimator implemented in #450 It generates the cumulative incidence function non-parametrically for the event of interest. It is different from Fine-Gray which is a parametric estimation method. Tentatively plan is to be part of 0.15.0 release but it works currently

but my current use case involves analyzing "deaths" from competing risks

Do you mean that death is your competing risk and you are interested in some other event (e.g. cancer) or that you are interested in the CIF of death?

Edit: This paper does a good job of describing the Aalen-Johansen estimator and approaches to competing risks

robdmc commented 5 years ago

tldr; It looks like something good is in the works. @CamDavidsonPilon feel free to close this issue.

Thanks for the quick response @pzivich and thanks for the reference. I'm looking forward to having that PR merged.

This is probably not the right forum for this, but since you asked... :) I am actually modeling a sales process. In sales, you have software that tracks "opportunities" for closing deals. I'm modeling the creation of the opportunity as "birth" and the closing of the opportunity as "death." Of course, there can be two reasons for closing an opportunity. You either won the deal or you lost it. I believe the correct model for that is a competing risk model. And, of course, I'm interested in the CIF of deals that were won.

pzivich commented 5 years ago

@robdmc Happy to help. Your application is interesting. My area is health statistics, so this a little outside my realm of conceptual thinking. However, losing the deal sounds like it would be a competing risk rather than censoring to me, since it "prevents" winning the deal