weibull_rmst {reconstructKM} | R Documentation |
RMST using Weibull fit
Description
RMST for time-to-event data under parametric Weibull fit for data in each arm separately. Also can provide CI for RMST estimate and difference in RMST.
Usage
weibull_rmst(num_boots = 1000, dat, tau, alpha, find_pval = FALSE, seed = NULL)
Arguments
num_boots |
Number of bootstrap iterations |
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 |
find_pval |
Boolean, if TRUE then does bootstrap under the null to find p-value of mean difference and RMST difference |
seed |
For reproducibility |
Value
A list including out_tab (estimate and CI in both arms), trt_rmst, pbo_rmst, diff_rmst, trt_CI, pbo_CI, diff_CI. Assumes trt coded as arm 1 and placebo coded as arm 0.
Examples
time <- rexp(100)
status <- rbinom(n=100, prob=0.5, size=1)
arm <- c( rep(1, 50), rep(0, 50))
dat <- data.frame(time=time, status=status, arm=arm)
weibull_rmst(dat=dat, tau=1, alpha=0.05, num_boots=200)
[Package reconstructKM version 0.3.0 Index]