rmst() gives the restricted mean survival time up to tau: the area under the survival curve
on \([0, \tau]\), which is the expected survival time over that window. Unlike the median, it
uses all the follow-up in the window and is defined even when the curve never reaches 0.5.
rmrl() gives the restricted mean residual life at a landmark s: the expected additional
survival time in \((s, \tau]\) for subjects who survive to s,
\(\int_s^\tau S(u)\,du / S(s)\). rmrl(fit, 0, tau) equals rmst(fit, tau).
Usage
rmst(object, tau, ...)
rmrl(object, s, tau, ...)
# S3 method for class 'kaplan_meier'
rmst(object, tau, ...)
# S3 method for class 'kaplan_meier'
rmrl(object, s, tau, ...)
# S3 method for class 'turnbull'
rmst(object, tau, ...)
# S3 method for class 'turnbull'
rmrl(object, s, tau, ...)Arguments
- object
A fit with a survival curve, such as a
kaplan_meier()fit.- tau
The end of the window.
- ...
Passed to methods.
- s
The landmark time, at least 0 and less than
tau.
Value
A data frame with one row per group: strata, the grouping variables, tau (and s
for rmrl()), estimate, std_error, conf_low, and conf_high. The estimate of rmrl()
is NA for a group in which everyone has had the event by s.
Details
The standard error is the usual restricted-mean estimator,
\(\sqrt{\sum A_i^2 d_i / (n_i (n_i - d_i))}\) over the event times \(t_i \le \tau\), where
\(A_i\) is the area under the curve from \(t_i\) to \(\tau\). For rmrl() the sum runs
over \((s, \tau]\) and is divided by \(S(s)\). Confidence limits are the estimate plus or
minus \(z\) standard errors, with the lower limit floored at 0.
Examples
lung <- data.frame(
time = c(306, 455, 1010, 210, 883, 1022, 310, 361, 218, 166),
status = c(2, 2, 1, 2, 2, 1, 2, 2, 2, 2),
sex = c(1, 1, 1, 1, 1, 2, 2, 2, 2, 2)
)
fit <- kaplan_meier(Surv(time, status) ~ sex, data = lung)
rmst(fit, tau = 365)
#> strata sex tau estimate std_error conf_low conf_high
#> 1 sex=1 1 365 322.2 27.09007 269.1044 375.2956
#> 2 sex=2 2 365 284.0 35.46604 214.4878 353.5122
rmrl(fit, s = 200, tau = 730)
#> strata sex s tau estimate std_error conf_low conf_high
#> 1 sex=1 1 200 730 286.20 95.62611 98.77628 473.6237
#> 2 sex=2 2 200 730 204.75 97.32508 13.99634 395.5037