get_rmst_estimate {bunsen}R Documentation

Calculate the marginal restricted mean survival time (RMST) when adjusting covariates in clinical trials

Description

Estimate the marginal RMST (point estimate) using the Karrison et al.(2018). Standard errors (SE) were estimated using the methods from Zucker (1998), Chen and Tsiatis (2001), and Wei et al.(2023). We implemented both nonparametric(bootstrap) and parametric methods(delta) for SE.

Usage

get_rmst_estimate(
  time,
  status,
  trt,
  covariates = NULL,
  tau,
  SE = "delta",
  n.boot = 1000,
  seed = 1
)

Arguments

time

A vector containing the event time of the sample.

status

A vector containing the survival status of the sample.

trt

A vector indicating the treatment assignment. 1 for treatment group. 0 for placebo group.

covariates

A data frame containing the covariates. If covariates is NULL, unadjusted RMST is returned.

tau

Numeric. A value for the restricted time or the pre-specified cutoff time point.

SE

Character. If SE = 'boot', SE was estimated using nonparametric bootstrap. If 'delta', SE was estimated using the delta method. Default is 'delta'.

n.boot

Numeric. Number of bootstrap used. Only used if SE = 'boot'.

seed

Numeric. Random seed for bootstrap. Default:1.

Details

Restricted mean survival time is a measure of average survival time up to a specified time point. We adopted the methods from Karrison et al.(2018) for estimating the marginal RMST when adjusting covariates. For the SE, both nonparametric bootstrap and delta method are good for estimation. For the delta estimation of variance,we used a combined estimation including Zucker (1998) and Chen and Tsiatis (2001). SE (delta) = variance from Zucker (1998) + additional variance component from Chen and Tsiatis (2001).The additional variance is coming from treating covariates as random.

Value

A list including marginal RMST and SE.

References

Examples


data("oak")
tau <- 26
time <- oak$OS
status <- oak$os.status
trt <- oak$trt
covariates <- oak[, c("btmb", "pdl1")]
get_rmst_estimate(time, status, trt, covariates, tau, SE = "delta")

[Package bunsen version 0.1.0 Index]