Type: | Package |
Title: | One-Arm Clinical Trial Designs for Time-to-Event Endpoint |
Version: | 1.0 |
Maintainer: | Heng Zhou <heng.zhou@merck.com> |
Description: | Get operating characteristics of one-arm clinical trial designs for time-to-event endpoint through simulation and perform analysis with time-to-event data. |
Imports: | tibble, dplyr, tidyr, survival |
Depends: | R (≥ 3.6) |
License: | GPL-3 |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 7.1.2 |
NeedsCompilation: | no |
Packaged: | 2022-09-08 02:52:23 UTC; zhouheng |
Author: | Heng Zhou [aut, cre], Keaven Anderson [aut], Linda Sun [aut], Meihua Wang [aut] |
Repository: | CRAN |
Date/Publication: | 2022-09-08 09:23:01 UTC |
Perform analysis on the data of one-arm clinical trial with time-to-event endpoint
Description
This function can get analysis results on the input trial data using several approaches for
one-arm trial design with time-to-event endpoint. Default approaches include one-sample log-rank
test, Landmark Kaplen-Meier method and binary method which regards the survival of each subject
at a landmark is a binary variable. In addition, if RWdata
is not NULL
, the RWdata
input will be used as an external control and cox model will be used to evaluate the treatment effect
of input trial data (experimental arm) compared with the external control.
Usage
OneArmTTEAnalysis(
data,
eventRates.ctrl,
landmark,
RWdata = NULL,
RWSurvCal = FALSE,
conf.type = "plain",
alpha = 0.05
)
Arguments
data |
Trial data. A tibble/data.frame containing |
eventRates.ctrl |
Event rates of historical control. |
landmark |
The landmark of interest to evaluate the survival rate for Landmark Kaplan-Meier method and binary method. |
RWdata |
The real world data to be used as external control; A tibble/data.frame containing |
RWSurvCal |
Indicator of whether to calculate historical cumulative hazard and survival rate at landmark from real world data; default is FALSE. |
conf.type |
Type of confidence interval in the survival model; One of " |
alpha |
Type I error rate level. |
Details
This function outputs a list of analysis results of each design, including: 1) p-value of one-sample log-rank test, 2) historical survival rate at landmark, 3) survival rate estimate with confidence interval of landmark kaplan-meier method, 4) survival rate estimate with confidence interval of binary method, 5) p-value of binary method, 6) hazard ratio estimate with confidence interval compared with real world data (if available), 7) p-value of log-rank test compared with real world data (if available).
Value
No visible return values.
Examples
library(survival)
data(example_data)
# Piecewise exponential of historical control
median.ctrl <- c(14.3, 1.5, 4.9)
eventRates.ctrl <- tibble::tibble(duration=c(4,2,100),rate=log(2)/median.ctrl)
OneArmTTEAnalysis(example_data, eventRates.ctrl, landmark=6)
Get operating characteristics of one-arm clinical trial design with time-to-event endpoint
Description
Using simulation, this function can get operating characterisitics of several approaches for
one-arm trial design with time-to-event endpoint. Default approaches include one-sample log-rank
test, Landmark Kaplen-Meier method and binary method which regards the survival of each subject
at a landmark is a binary variable. In addition, if RWdata
is not NULL
, the RWdata
input will be used as an external control and cox model will be used to evaluate the treatment effect
of simulated data (experimental arm) compared with the external control. The output includes
probability of rejecting null hypothesis of each design, average number of events at analysis,
and average analysis time after last patient in. When eventRates
is same as eventRates.ctrl
,
the probability of rejecting null hypothesis is type I error; When eventRates
is the alternative
hypothesis from desirable treatment effect, the probability of rejecting null hypothesis is power.
Usage
OneArmTTEDesign(
n,
eventRates.ctrl,
eventRates,
enrollRates,
dropoutRates,
cutTime,
landmark,
Event = FALSE,
n.event,
RWdata = NULL,
RWSurvCal = FALSE,
conf.type = "plain",
alpha = 0.05,
nsim = 10000,
seed = 43
)
Arguments
n |
Number of subjects. |
eventRates.ctrl |
Event rates of historical control. |
eventRates |
Event rates of subjects in the trial. |
enrollRates |
Enrollment rates of subjects in the trial. |
dropoutRates |
Dropout rates of the subjects in the trial. |
cutTime |
Analysis time after last patient in; not used if Event=TRUE. |
landmark |
The landmark of interest to evaluate the survival rate for Landmark Kaplan-Meier method. |
Event |
Indicator of whether the analysis is driven by number of events; default is FALSE. |
n.event |
Number of events at analysis; not used if Event=FALSE. |
RWdata |
The real world data to be used as external control; A tibble/data.frame containing |
RWSurvCal |
Indicator of whether to calculate historical cumulative hazard and survival rate at landmark from real world data as the null case; default is FALSE. |
conf.type |
Type of confidence interval in the survival model; One of " |
alpha |
Type I error rate level. |
nsim |
Number of simulations; default is 10000. |
seed |
Seed for simulation. |
Details
The function output a list of the operating characteristics including: 1) probability of rejecting null hypothesis of each design, 2) average number of events at analysis, 3) average analysis time after last patient in.
Value
No visible return values.
Examples
library(survival)
# Piecewise exponential of historical control
median.ctrl <- c(14.3, 1.5, 4.9)
eventRates.ctrl <- tibble::tibble(duration=c(4,2,100),rate=log(2)/median.ctrl)
# Piecewise exponential assumption of treatment:
# Hazard ratio = 1 for time 0-3 and Hazard ratio = 0.47 after
eventRates.trt = tibble::tibble(duration=c(3,1,2,100),rate=log(2)/c(14.3, median.ctrl/0.47))
# Constant enrollment rates and dropout rates
enrollRates = tibble::tibble(duration=106, rate=14/3)
dropoutRates = tibble::tibble(duration=106, rate=0.2/12)
OneArmTTEDesign(n=40, eventRates.ctrl, eventRates.trt, enrollRates, dropoutRates, cutTime=3,
landmark=6, Event=FALSE, conf.type = 'plain', alpha=0.05, nsim=100, seed=43)
Get Cumulative Hazard at a Landmark Timepoint
Description
Get Cumulative Hazard at a Landmark Timepoint
Usage
cumhazard(
eventRates = tibble::tibble(duration = c(3, 100), rate = c(log(2)/5, log(2)/5 * 0.5)),
landmark
)
Arguments
eventRates |
A tibble containing period duration ( |
landmark |
The landmark of interest to evaluate cumulative hazard. |
Value
A numeric which is the cumulative hazard at a landmark timepoint.
Examples
# Piecewise exponential event rates of 0.5 for time 0-3, 0.4 for time 3-6, and 0.5 after
cumhaz <- cumhazard(eventRates=tibble::tibble(duration = c(3,3,100),rate = c(0.5, 0.4, 0.3)),
landmark=12)
An Example Trial Dataset
Description
A dataset containing the time-to-event information. The variables are as follows
Usage
data(example_data)
Format
A data frame with 3 variables and 200 observations
Details
time. event or censoring time
censor. censoring indicator; 1=event
Trt. treatment arm name
Generate Piecewise Exponential Enrollment
Description
Generate Piecewise Exponential Enrollment
Usage
rpwenroll(n = NULL, enrollRates = tibble(duration = c(1, 2), rate = c(2, 5)))
Arguments
n |
Number of observations.
Default of |
enrollRates |
A tibble containing period duration ( |
Value
A vector of random enrollment times following piecewise exponential distribution.
Examples
# piecewise uniform (piecewise exponential inter-arrival times) for 10k patients enrollment
# enrollment rates of 5 for time 0-100, 15 for 100-300, and 30 thereafter
x <- rpwenroll(n=10000, enrollRates=tibble::tibble(rate = c(5, 15, 30), duration = c(100,200,100)))
plot(x,1:10000,
main="Piecewise uniform enrollment simulation",xlab="Time",
ylab="Enrollment")
# exponential enrollment
x <- rpwenroll(10000, enrollRates=tibble::tibble(rate = .03, duration = 1))
plot(x,1:10000,main="Simulated exponential inter-arrival times",
xlab="Time",ylab="Enrollment")
The Piecewise Exponential Distribution
Description
The piecewise exponential distribution allows a simple method to specify a distribtuion
where the hazard rate changes over time. It is likely to be useful for conditions where
failure rates change, but also for simulations where there may be a delayed treatment
effect or a treatment effect that that is otherwise changing (e.g., decreasing) over time.
rpwexp()
is to support simulation of both the Lachin and Foulkes (1986) sample size
method for (fixed trial duration) as well as the Kim and Tsiatis(1990) method
(fixed enrollment rates and either fixed enrollment duration or fixed minimum follow-up).
Usage
rpwexp(n = 100, failRates = tibble(duration = c(1, 1), rate = c(10, 20)))
Arguments
n |
Number of observations to be generated. |
failRates |
A tibble containing |
Details
Using the cumulative=TRUE
option, enrollment times that piecewise constant over
time can be generated.
Value
A vector of random event times following piecewise exponential distribution.
Examples
# get 10k piecewise exponential failure times
# failure rates are 1 for time 0-.5, 3 for time .5 - 1 and 10 for >1.
# intervals specifies duration of each failure rate interval
# with the final interval running to infinity
x <- rpwexp(10000, failRates=tibble::tibble(rate = c(1, 3, 10), duration = c(.5,.5,1)))
plot(sort(x),(10000:1)/10001,log="y", main="PW Exponential simulated survival curve",
xlab="Time",ylab="P{Survival}")
# exponential failure times
x <- rpwexp(10000, failRates=tibble::tibble(rate = 5, duration=1))
plot(sort(x),(10000:1)/10001,log="y", main="Exponential simulated survival curve",
xlab="Time",ylab="P{Survival}")