使用以下数据框:
death <- 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)
age<-c (70,50,60,60,55,46,50,60,59,61,62,55,66,60,59,58,61,59,58,60,60,58,60,60,61,61,59,60,61,64)
survival_time <- 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)
diabetes <- 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(death, survival_time, diabetes, bloodpressure,age)
我得到的变量是血压、心血管死亡率、生存时间、糖尿病、年龄。我想调整年龄和糖尿病。
有没有办法在 R 或 SPSS 中做到这一点?
我的第一次尝试并没有达到我希望的结果:
cfit4a <- coxph(Surv(survival_time, death) ~ age + diabetes + bloodpressure, data=data)
surv4a <- survfit(cfit4a)
plot(surv4a, col=c(1,2,4), mark.time=F, xscale=365.25, xlab="blood pressure", ylab="Survival")
如何创建在 x 轴上显示血压值的图?如何在 y 轴上显示调整后的风险而不是生存率?(我在上面的原始帖子中添加了一个示例数据)