Baseline value of covariates in Cox's Proportional Hazard Model #1263
-
I am using Cox's proportional hazard model for survival regression. As the documentation shows (https://lifelines.readthedocs.io/en/latest/Survival%20Regression.html#interpretation) The exponent of the coefficient of a particular covariate in the model equals the hazard ratio of the possible values of such covariate. For example, in the case of the binary covariate marr (married or unmarried), the exponent of the coefficient of this covariate is the ratio of the hazard of married subjects and the hazard of unmarried subjects (at time t). Is there a way to select which hazard (married or unmarried) goes in the numerator and denominator? In the case of a continuous (discrete) covariate, is there a way to select which value of the covariate is considered the "baseline"? Thanks to the function plot_partial_effects_on_outcome (https://lifelines.readthedocs.io/en/latest/Survival%20Regression.html#plotting-the-effect-of-varying-a-covariate) it is possible to see which value of a given covariate is taken as the baseline, but I wonder if it is possible for the user to manually select a particular value. In case it is not possible, what is the choice criterium of the algorithm? Thank you very much. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @BorjaGIH - good questions:
Sure, this is how you design your covariate matrix. If you define "unmarried" to be equal to 1 in the matrix, then that will be the numerator. So it just depends on how you choose to encode variables.
It's currently not possible to set to a particular value, and I don't plan to make this possible. What is your use case? Currently for continuous variables, the median value is chosen as the baseline. |
Beta Was this translation helpful? Give feedback.
Hi @BorjaGIH - good questions:
Sure, this is how you design your covariate matrix. If you define "unmarried" to be equal to 1 in the matrix, then that will be the numerator. So it just depends on how you choose to encode variables.
It's currently not possible to set to a particular value, and I don't plan to make this possible. What is your use case? Currently for continuous variables, the median value is chosen as the baseline.