0

I'm currently using lifelines to carry out coxph survival analysis. I'm wondering if there's any library or functions that can help me to carry out spline regression analyses for the coxph model?

Something like this:

https://i.stack.imgur.com/0E2WN.jpg (Sorry I don't have enough reputation to post image)

I have found lots of instructions for R but not for python.

Tran Tran
  • 3
  • 1

1 Answers1

0

It can be done, but it's a bit clunky: https://gist.github.com/CamDavidsonPilon/d6c2f6acea390d81a5c33150222ac70e

A future release of lifelines will make this much easier to do, and incorporate Patsy formulas natively.

Cam.Davidson.Pilon
  • 1,606
  • 1
  • 17
  • 31