以下示例通过添加“年龄”从文档示例修改
d.coxph <- (survfit(Surv(time, status) ~ sex+age, data = lung))
autoplot(d.coxph)
我会收到以下错误:
levels<-
( , value = if (nl == nL) as.character*tmp*
(labels) else paste0(labels, : 因子级别 [41] 重复输入帧号,或 0 退出
1: autoplot(d.coxph)> Error in
levels<-
(*tmp*
, value = if (nl == nL) as.character(labels) else paste0(labels, : factor level [41] is duplicated输入帧号,或 0 退出
1: autoplot(d.coxph) 2: autoplot.survfit(d.coxph) 3: 强化(object, surv.connect = surv.connect, fun = fun) 4: fortify.survfit(object, surv.connect = surv.连接,乐趣 = 乐趣)5:因子(代表(组 ID,模型 $strata),级别 = 组 ID)
2: autoplot.survfit(d.coxph) 3: 强化(对象, surv.connect = surv.connect, fun = fun) 4: fortify.survfit(object, surv.connect = surv.connect, fun = fun) 5:因子(rep(groupIDs,model$strata),levels = groupIDs)