CamDavidsonPilon / lifelines

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

Confidence Intervals for Allen's Predict function #324

Open gmckinnon opened 7 years ago

gmckinnon commented 7 years ago

Any chance someone has coded something up to return the confidence intervals along with the predicted survival curve from a additive model?

Ideally you could run the predict_survival_function with a option to include the confidence interval from confidenceintervals

If not I'll code it up and submit it if it would be worth including

cheers,

CamDavidsonPilon commented 7 years ago

I would love this PR. I have had it in the back of my mind, but not really had the opportunity to dig into the literature and figure it out.

Even if you could do that part, and skip the implementation, that would be appreciated.

gmckinnon commented 7 years ago

Hi Cam, Am I wrong in assuming I could use your existing code for generating individual cumulative hazards but substitute the confidence interval values from the aaf.confidence_intervals function and then take the exponential of the negative value for both upper and lower bounds?

I have done this and while the upper confidence bound seems quite high overall it seems to work.

CamDavidsonPilon commented 7 years ago

maybe - that sounds sensible, but I'm not 100% sure that's accurate

hamiltonoh commented 2 years ago

Anyone figure this out?