Error in Surv(data, OSd) : Time variable is not numeric R语言绘图报错
·
Error in Surv(data, OSd) : Time variable is not numeric R语言绘图报错
以下是问题片段:
// 建立cox模型
cph8 <- cph(Surv(data$OSd, data$OS) ~ HKLC, data = data)
// DCA曲线
dca_cph <- dca(cph8, model.names = c("HKLC stage"),times = c(365, 1095, 1825))
#head(dca_cph)
ggplot(dca_cph)#, lwd = 0.5
画图会报错
Error in Surv(data, OSd) : Time variable is not numeric
应该修改为
// 建立cox模型
cph8 <- cph(Surv(OSd, OS) ~ HKLC, data = data)
接下来ggDCA绘图,成功!!!
更多推荐
所有评论(0)