I am trying to plug the regression coefficients back into the cox ph model to manually find the partial hazard of the model, but am getting mixed results. I am using the lifelines python library for Cox PH.
For one observation:
The partial_hazard
is the product the lifelines python library outputted.
Each variable below is the sum of the observed value for xi * coefficient B.
partial_hazard = 0.606
n1 = 29835.02039 * 0.398
n2 = 3.949135 * 0.145
n3 = 0.477231 * 0.18
n4 = 123.658238 * -0.21
n5 = -0.771495 * 0.134
n6 = 0.750476 * -0.124
If I plug in the values from above it returns inf
np.exp(n1 + n2 + n3 + n4 + n5 + n6)
The baseline hazard = 0.001
according to the lifelines library.
To get the hazard h(t|x):
0.001 * np.exp(n1 + n2 + n3 + n4 + n5 + n6)
However, the sum (above) does not equal partial_hazard = np.log(0.606)
Is this logic correct? Any practical input would be appreciated.