title: How to Adjust restricted cubic spline cox model using rms package?
body: <p>I am trying to plot a restricted cubic spline model using the <code>rms</code> package. However I don't find any way to adjust my cox proportional hazard model, I can only get the unadjusted fit. 
  Here is my code: </p>
  
  <pre><code>library(survival)
  library(rms)
  
  dd &lt;- datadist(Cox9)
  options(datadist="dd")
  
  fit &lt;- cph(Surv(follcox,evento) ~  rcs(G_VINO,3))
  plot(Predict(fit_vino), lty=1, lwd=3, ylim=c(-0.5,1.0),xlim = c(0,50), col="white") 
  </code></pre>
  
  <p>With this coding I get the unadjusted spline model. 
  I wondered how can I add the confounding variables to adjust the model. 
  I tried: </p>
  
  <pre><code>fit_vino_adj &lt;- cph(Surv(follcox,evento) ~rcs(G_VINO+edad0+actfis+energia))
  plot(Predict(fit_vino_adj), lty=2, lwd=2)
  </code></pre>
  
  <p>But that gives me the splines model of each variable separately, anyone has an idea how can I adjust my model?</p>