rmst: Restricted mean survival time

View source: R/rmst.R

rmstR Documentation

Restricted mean survival time

Description

Computes the restricted mean survival time for both treatment arms.

Usage

rmst(obj, tau0 = NULL, tau1 = NULL)

Arguments

obj

An object of class surv.delay

tau0

Truncation time for control arm

tau1

Truncation time for active treatment arm

Value

A list with the following two components

rmst0

The estimated restricted mean survival time in the control arm

rmst1

The estimated restricted mean survival time in the active treatment arm

Author(s)

Nicholas Henderson

Examples

## Not run: 
### Generate simulated survival data
n <- 400
cens.time <- 8
X1 <- rweibull(n, shape=2.3, scale=7)
X2 <- rweibull(n, shape=.8, scale=10)
Y1 <- pmin(X1, cens.time)
Y2 <- pmin(X2, cens.time)
e1 <- as.numeric(X1 < cens.time)
e2 <- as.numeric(X2 < cens.time)

times <- c(Y1, Y2)  ## follow-up times
events <- c(e1, e2) ## event indicators
trt <- rep(c(0,1), each=n)  ## treatment arm assignment

dfs.obj <- DelayedSurvFit(times, events, trt, max.times=50) 
rmst(dfs.obj)

## End(Not run)

nchenderson/DelayedSurvFit documentation built on Aug. 18, 2024, 11:49 a.m.