Are there any packages in Python for survival analysis? Specifically, I am interested in performing a Cox regression?
I know this example but it's in R. Could we just interface Python with R (using, for example, rpy2)?
Cox regression (or proportional hazards regression) is method for investigating the effect of several variables upon the time a specified event takes to happen. In the context of an outcome such as death this is known as Cox regression for survival analysis.
Survival analysis is a set of statistical approaches used to find out the time it takes for an event of interest to occur. Survival analysis is used to study the time until some event of interest (often referred to as death) occurs. Time could be measured in years, months, weeks, days, etc.
The Cox proportional-hazards model (Cox, 1972) is essentially a regression model commonly used statistical in medical research for investigating the association between the survival time of patients and one or more predictor variables.
The lifelines package in Python offers survival analysis, including the Cox proportional hazard fitter: https://lifelines.readthedocs.io/en/latest/
I would just like to provide a more updated answer as of July 2020:
pandas
and has some great visualization tools out of the box. It is being constantly developed and updated. Moreover, its documentation is very thorough. I would even recommend reading it as a starting point for studying survival analysis in general.scikit-learn
, which makes it very easy to couple with other building blocks in your pipeline. Moreover, it includes implementations of ML algorithms for survival, such as Random Survival Forests and SSVMs.One more library to add to @arturo's list:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With