Plot of hazard ratio for primary endpoint and continuous covariate I wonder if you could tell me the R code to use to obtain a graph similar to the one below. (from: https://www.nejm.org/doi/full/10.1056/NEJMoa1215740)

That is, I would like to graph the association between the hazard ratio of the primary endpoint (EVENT) VS a continuous covariate (VALUE).
My cox model is as follows:
cox<- coxph(Surv(TIME, EVENT) ~ VALUE, data = EBB)


require(rms)
dd <- datadist(mydata); options(datadist='dd')
f <- cph(Surv(time, event) ~ rcs(glucose, 4), data=mydata)
ggplot(Predict(f))

To have more control over the plot use the contrast function (full name contrast.rms) and plot its results as shown in the help file for contrast.rms.
