rmst.Stat: Restricted Mean Survival Test Statistic

Description Usage Arguments Details Value Examples

View source: R/rmst.Stat.r

Description

RMST method with user specified trucation time.

Usage

1
rmst.Stat(survival, cnsr, trt, stra = NULL, fparam = NULL)

Arguments

survival

time-to-event variable

cnsr

censoring variable: 1=censoring, 0=event

trt

treatment varaible. Accepted values are either "experiment" or "control"

stra

stratification variable. Default is NULL (currently not implemented)

fparam

the cutoff time for RMST analysis. If larger than the minimum of the largest observed time on each of the two arms, the minimum value will be used.

Details

Restricted mean survival test at specified cutoff time. This is adopted from rmst2.

Value

The function return a list with the follow components

pval

One-sided p-Value from RMST comparing treatment arm to control arm

tau

time cutoff used for each analysis

est

Estimated difference between treatment and control arm

estlb, estub

Lower and upper bound of the estimated difference

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# RMST on the simulated data
library(survRM2)
medC = 6 
hr <- 0.7
intervals <- NULL 
gamma <- c(2.5, 5,  7.5,  10) ## a ramp-up enrollment
R     <- c(2  , 2,  2  ,  6 ) ## enrollment period: total of 12 months
eta <- -log(0.99) ## 1% monthly dropout rate
sim1 <- nphsim(nsim=1,lambdaC=log(2)/medC,lambdaE=log(2)/medC*hr, ssC=300,ssE=300,
               intervals=intervals,gamma=gamma, R=R,eta=eta)
test1 <- simtest(x=sim1, anaD=c(250,300), method=rmst.Stat,fparam=12)
test1$result[]

# direct function call (without cutoff)
rmst.Stat(surv=sim1$simd$survival, cnsr=sim1$simd$cnsr, trt=sim1$simd$treatment,fparam=12)

keaven/nphsim documentation built on May 24, 2020, 9:34 p.m.