0

I have a cox model with variables of age, living environment, Rankin, side of stroke, and systolic blood pressure. Summary of model is:

                         coef exp(coef)  se(coef)      z        p
age                 0.061691  1.063634  0.009349  6.598 4.16e-11
preliv1             0.818710  2.267573  0.316903  2.583  0.00978
prerank1            0.944284  2.570972  0.214455  4.403 1.07e-05
prerank2            2.586012 13.276721  1.082256  2.389  0.01687
side1               4.076834 58.958496  0.776908  5.248 1.54e-07
poly(bpsysadm, 2)1 -3.063463  0.046726  1.458950 -2.100  0.03575
poly(bpsysadm, 2)2  1.876006  6.527384  1.502533  1.249  0.21183

When I predict from this using the predict function on the following data:

age = 77    
preliv = 0  
prerank = 0 
side = 0
bpsysadm = 121  

I get 0.6124938, when I calculate manually I get 27666.62, which is obviously because of the bpsysadm^2.

(0.0609)*(77) + (0.863)*(0) + (0.876)*(0) + (2.435)*(0) + (4.048)*(0) + (-3.104)*(121) + 1.915)*(121)^2 

how am I going so wrong here?

Phil
  • 7,287
  • 3
  • 36
  • 66
  • 1
    `poly` does not handle arguments that way. (It would if you had set "raw=TRUE" but it does not appear that you did so.) Look at the output of `poly(1:10, 2)` and compare with the output of `poly(1:10, 2, raw=TRUE)` – IRTFM Feb 26 '23 at 02:01

0 Answers0