# Plugging in Regression Coefficients back into Cox PH Model

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.

I can't speak to lifelines-specific issues (software per se is generally off-topic on this site), but there are a few things you need to double-check and understand in general.
First, your n1 predictor has an outrageously high contribution to the log-partial hazard sum (the linear predictor from the model), leading to the overflow. Check that for a coding or scaling error, along with n4 (which is only extremely high). (A summed linear predictor value of only 2 means a hazard ratio greater than 7, which is quite high in my experience. On that basis, there's something terribly wrong with n1 and n4, maybe something like perfect separation in logistic regression.)