我正在尝试打印由survfit
包创建的survival
对象的受限平均生存和标准错误。当我从完整数据中运行以下示例摘录时,我无法在摘要中显示rmean
(在我的完整数据中运行所有1000个obs时也不会显示)。
require(survival)
dat <- structure(list(treat = c("Treat", "Control", "Treat", "Treat",
"Control", "Treat", "Treat", "Control", "Control", "Treat", "Treat",
"Control", "Control", "Control", "Treat", "Control", "Treat",
"Control", "Control", "Control", "Control", "Control", "Control",
"Control", "Control", "Control", "Control", "Control", "Control",
"Control", "Control", "Control", "Control", "Control", "Treat",
"Control", "Control", "Control", "Treat", "Control", "Control",
"Control", "Control", "Treat", "Control", "Treat", "Control",
"Treat", "Treat", "Control"), days = c(40, 90, 90, 90,
90, 90, 90, 90, 90, 59, 51, 68, 90, 90, 51, 2, 29, 64, 90, 90,
90, 81, 35, 19, 55, 90, 90, 90, 90, 90, 90, 90, 40, 3, 38, 90,
32, 90, 90, 67, 42, 90, 90, 90, 66, 90, 90, 90, 90, 90), status = c(1,
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1,
1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0,
0, 1, 0, 0, 0, 0, 0)), .Names = c("treat", "days", "status"
), row.names = c(NA, 50L), class = "data.frame")
t.Surv <- Surv(dat$days, dat$status==1)
print(survfit(t.Surv~treat, data=dat), show.rmean=TRUE)
# Call: survfit(formula = t.Surv ~ treat, data = dat)
# records n.max n.start events median 0.95LCL 0.95UCL
# treat=Control 35 35 35 13 NA 81 NA
# treat=Treat 15 15 15 6 NA 51 NA
答案 0 :(得分:1)
参数为print.rmean
,而不是show.rmean
。
> print(survfit(t.Surv~treat, data=dat), print.rmean=TRUE)
Call: survfit(formula = t.Surv ~ treat, data = dat)
records n.max n.start events *rmean *se(rmean) median 0.95LCL 0.95UCL
treat=Control 35 35 35 13 73.0 4.51 NA 81 NA
treat=Treat 15 15 15 6 71.9 5.96 NA 51 NA
* restricted mean with upper limit = 90