title: How to plot a Cox hazard model with splines
body: <p>I have a following model:</p>
  
  <pre><code>coxph(Surv(fulength, mortality == 1) ~ pspline(predictor))
  </code></pre>
  
  <p>where is fulength is a duration of follow-up (including mortality), predictor is a predictor of mortality.</p>
  
  <p>The output of the command above is this:</p>
  
  <pre><code>                         coef  se(coef) se2    Chisq DF   p    
  pspline(predictor), line 0.174 0.0563   0.0562 9.52  1.00 0.002
  pspline(predictor), nonl                       4.74  3.09 0.200
  </code></pre>
  
  <p>How can I plot this model so that I get the nice curvy line with 95% confidence bands and hazard ratio on the y axis? What I am aiming for is something similar to this:</p>
  
  <p><img src="https://i.stack.imgur.com/qnWsL.png" alt="enter image description here"></p>