rmst | R Documentation |
Calculate the restricted mean survival time (RMST) for Surv object, Cox proportional model and other survival objects.
rmst(object, ...)
## Default S3 method:
rmst(object, ...)
## S3 method for class 'coxph'
rmst(object, newdata = NULL, linear.predictors = NULL, tau=NULL, ...)
## S3 method for class 'Surv'
rmst(object, tau = NULL, ...)
object |
for rmst.Surv and rmst.default, it is a survival object created by Surv(time, event). For others, it is a model object returned by coxph, lple. |
linear.predictors |
the linear predictor from the Cox PH model. |
newdata |
optional new data at which the RMST is calculated. If absent, RMST is for the dataframe used in the original model fit. |
tau |
the time point at which the Brier score is calculated. |
... |
additional arguments to be passed to the functions such as rmst.coxph, rmst.lple, rmst.Surv etc. |
The restricted mean survival time (RMST) is the mean of the truncated survival time at some finite value tau. The RMST is defined as,
RMST(tau) = E(min(T, tau)) = int_0 ^tau S(t)dt,
where S(t) = P(T>t) is the survival function of the random variable T.
A value of the Brier score or integration of the Brier score is returned.
Bingshu E. Chen
coxph
,
Surv
set.seed(29)
n = 25
time = rexp(n, 1)
event = rbinom(n, 1, 0.75)
x = rnorm(n)
y = Surv(time, event)
### calculate the restricted mean survival time at tau = 0.5
rms = rmst(y, tau = 0.5)
### calculate the integrated brier score
#fit = coxph(y~x)
#RMST = rmst(fit, tau = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.