square / pysurvival

Open source package for Survival Analysis modeling
https://www.pysurvival.io/
Apache License 2.0
343 stars 105 forks source link

cox coefs don't match that of most other packages #40

Open nebarlow opened 3 years ago

nebarlow commented 3 years ago

I ran a comparison from lifelines loaded data (rossi)

# lifelines
from lifelines.datasets import load_rossi
from lifelines import CoxPHFitter

# load dada
rossi = load_rossi()

And the pysurvival cox coefficients don't match. I also repeated for scikit-survival, and statsmodels. The age effect is an order of magnitude larger than the other packages.

nebarlow commented 2 years ago

Thanks, well spotted!

Sent from my iPhone

On 25 Sep 2021, at 14:37, xqccc30 @.***> wrote:

 I did the same experiment before, and even rewrote the cox analysis code myself. pysurvival package is really inconsistent with other analysis results, and the inconsistency mainly appears in cox coefficient. After looking at the author's source code, it is found that the author standardized before analysis. And this standardization process is encapsulated in a package. When you standardize the data before analyzing other packages and then process it, the results will be consistent. Or rewrite and change the author's source code, take standardization as an incoming parameter, and flexibly choose whether to standardize or not. My English is not very good. I hope my answer will be useful to you.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.