Question

I am trying to print the restricted mean survival and the standard error of a survfit object created by the survival package. When I run the following example excerpt from my full data, I can't get rmean to show in the summary (does not show when running on all 1000 obs from my full data either).

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
Was it helpful?

Solution

The argument is print.rmean, not 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 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top