我有一个导入 R 的数据集。我成功地在数据集上运行了 survfit。我有一列显示患者存活的时间,另一列显示患者是否存活的 (0/1) 结果。我知道尝试对coxph()
数据进行操作,并且正在使用以下内容。
coxph <- coxph(Surv(mydata$V11, mydata$event), method ="breslow")
但是,我不断收到以下错误。我试过as.numeric
在变量上使用,但这仍然不能解决问题。我还尝试mydata$
从上面代码行中的每个变量中删除。谢谢你。
Error: $ operator is invalid for atomic vectors