nonparam_rmst: Calculate RMST for each arm as well as contrast

Description Usage Arguments Value Examples

View source: R/nonparam_rmst.R

Description

Non-parametric RMST function that allows for the tau (follow-up time) to be arbitrarily large. Uno package restricts it to be min(last observed event in either arm). Provides estimate, SE, CI for each arm. Provides same for difference in arms (and also p-value).

Usage

1
nonparam_rmst(dat, tau, alpha = 0.05)

Arguments

dat

Data frame of time-to-event data which MUST have the columns 'time', 'arm', and 'status

tau

How long of a follow-up to consider, i.e. we integrate the survival functions from 0 to tau

alpha

Confidence interval is given for (alpha/2, 1-alpha/2) percentiles

Value

A list including data.frame of results in each arm (RMST, RMTL, SE, pvalue, CI) as well as data.frame of results for Arm1 - Arm0 RMST.

Examples

1
2
3
4
5
time <- rnorm(100)
status <- rbinom(n=100, size=1, prob=0.5)
arm <- c( rep(1, 50), rep(0, 50))
dat <- data.frame(time=time, status=status, arm=arm)
nonparam_rmst(dat=dat, tau=1, alpha=0.05)

reconstructKM documentation built on Nov. 25, 2020, 5:08 p.m.