I'm interested in a continuous variable, namely blood pressure.
The higher the blood pressure, the greater the risk of heart attack and stroke. However, studies frequently report that also low blood pressure is associated adverse outcomes.
The question is: what is the optimal blood pressure? At what value of blood pressure does risk start to increase?
In other words, how can I model, and visualize graphically, what hazard ratio various levels of blood pressure is associated with. I suspect that some will suggest restricted cubic splines. Do you have any suggestions on suitable R packages that will help me visualize the effect of blood pressure on hazard. I'm fairly familiar with Cox regression and plan using the RMS package. Time-dependent variables are included.
Sample data (no time-dependent variables):
event <- c(1,0,1,0,0,0,0,1,0,0,0,1,1,0,1,0,0,1,0,1,1,1,1,0,1,1,1,0,0,1) survival <- c(4,29,24,29,29,29,29,19,29,29,29,3,9,29,15,29,29,11,29,5,13,20,22,29,16,21,9,29,29,15) statin <- c(0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0) bloodpressure <- c(160,120,150,140,135,110,139,140,153,129,149,163,179,129,144,119,100,115,145,150,130,120,122,129,116,171,129,126,159,150) data <- data.frame(event, survival, statin, bloodpressure) View(data) require(rms) fit <- coxph(Surv(survival, event) ~ statin + rcs(bloodpressure, 3), data=data)
I had something like this in mind: http://www.bmj.com/content/325/7372/1073/F1