2

survminer を使用して、ggadjustedcurves() で調整された生存曲線を作成しようとしています。私のコードは次のとおりです。

adjustedcurve <- coxph(Surv(time_DeathTxCensor, deadORtx==1) ~ strata(natADI_quart) + sex + FVCpctPre + DLCOpctPre + smokeHx + age_dx, data=ADI, id=ID)
ggadjustedcurves(adjustedcurve,
                 variable="natADI_quart",
                 method="conditional",
                 data=ADI)

そして、私はエラーメッセージを受け取っています:

if (xi > xj) のエラー 1L else -1L : TRUE/FALSE が必要な場所に値がありません

また、ここに私のトレースバックがあります:

16. .gt(structure(c(1L, 3L, 2L, 4L), .Label = c("1", "2", "3", "4" ), class = "factor"), 1L, 2L)
15. rank(x, ties.method = "min", na.last = "keep")
14. as.vector(rank(x, ties.method = "min", na.last = "keep"))
13. xtfrm.default(x)
12. xtfrm(x)
11. as.vector(xtfrm(x))
10. FUN(X[[i]], ...)
9. lapply(z, function(x) if (is.object(x)) as.vector(xtfrm(x)) else x)
8. order(x, na.last = na.last, decreasing = decreasing)
7. `[.tbl_df`(x, order(x, na.last = na.last, decreasing = decreasing))
6. x[order(x, na.last = na.last, decreasing = decreasing)]
5. sort.default(unique(data[, variable]))
4. sort(unique(data[, variable]))
3. ggadjustedcurves.conditional(data, fit, variable, size = size)
2. surv_adjustedcurves(fit = fit, variable = variable, data = data, reference = reference, method = method, size = size, ...)
1. ggadjustedcurves(adjustedcurve, data = ADI)

これが何を意味するのか、それを修正する方法がわかりません。本当に助けていただければ幸いです:)

4

1 に答える 1