Title: | Interim Monitoring Using Adaptively Weighted Log-Rank Test in Clinical Trials |
---|---|
Description: | For any spending function specified by the user, this package provides corresponding boundaries for interim testing using the adaptively weighted log-rank test developed by Yang and Prentice (2010 <doi:10.1111/j.1541-0420.2009.01243.x>). The package uses a re-sampling method to obtain stopping boundaries at the interim looks.The output consists of stopping boundaries and observed values of the test statistics at the interim looks, along with nominal p-values defined as the probability of the test exceeding the specific observed test statistic value or critical value, regardless of the test behavior at other looks. The asymptotic validity of the stopping boundaries is established in Yang (2018 <doi:10.1002/sim.7958>). |
Authors: | Daewoo Pak and Song Yang |
Maintainer: | Daewoo Pak <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.0.3 |
Built: | 2025-02-02 05:25:58 UTC |
Source: | https://github.com/cran/YPInterimTesting |
This virtual data set is created to show how to use the package.
data(virtual)
data(virtual)
The data has the following information:
time
the numeric matrix of event times for all interim looks up to the current look.
event
the numeric matrix of right-censoring indicators corresponding to time
(event = 1, censored = 0).
group
the numeric vector of the group indicator (treatment = 1, control = 0).
library(YPInterimTesting) data(virtual) time <- virtual$time colnames(time) # Check the order of the column names. head(time)
library(YPInterimTesting) data(virtual) time <- virtual$time colnames(time) # Check the order of the column names. head(time)
This package provides monitoring boundary for interim testing using the adaptively weighted log-rank test developed by Yang and Prentice (2010). It is shown in Yang (2018) that the adaptively weighted log-rank test is asymptotically fully efficient when the limiting censoring distributions in two groups are equal. For a given spending function, the main function of the package ypinterim
provides stopping boundaries at the interim looks, along with nominal p-values. The object being returned by the function ypinterim
can be formatted to a table using the function summary
.
Package: | YPInterimTesting |
Type: | Package |
Version: | 1.0.0 |
Date: | 2018-10-31 |
License: | GPL (>= 3) |
Daewoo Pak and Song Yang
Yang, S. (2018). Interim monitoring using the adaptively weighted log-rank test in clinical trials for survival outcomes. Statistics in Medicine. <doi:10.1002/sim.7958>
Yang, S., & Prentice, R. (2010). Improved logrank-type tests for survival data using adaptive weights. Biometrics, 66(1), 30-38.
Provides stopping boundaries and nominal p-values at the interim looks using the adaptively weighted log-rank test developed by Yang and Prentice (2010). The full details are available on Yang (2018).
## Default S3 method: ypinterim(time, event, group, spendfun, critvalue = NULL, repnum = 1E4, bound = 50, seed.fix = 0, ...)
## Default S3 method: ypinterim(time, event, group, spendfun, critvalue = NULL, repnum = 1E4, bound = 50, seed.fix = 0, ...)
... |
for S4 method only. |
time |
A numeric matrix of event times for all interim looks up to the current look. The columns of the matrix represent interim looks in date order. |
event |
A numeric matrix of right-censoring indicators corresponding to |
group |
A numeric vector of the group indicator (treatment = 1, control = 0). |
spendfun |
A numeric vector of the values for the spending function |
critvalue |
A vector of the previous critical values for the prior interim looks. If it is not supplied, the critical values at all the interim looks will be obtained all at once using the re-sampling method. This is only for the scenario when the user wants to test with historical data where all interim data are available. When using the package for an ongoing trial, at the first look, when the user supplies the data and the value of the spending function at the first look, the package provides the stopping boundary, the test statistic value and the nominal p-values at the first look. Then, at the |
repnum |
The number of replications for the re-sampling method used in the calculations. The default value is one million. When the alpha allocated is less than 1E-4 at some early looks, the package uses numerical integration to obtain the critical values at those looks. |
bound |
A boundary ( |
seed.fix |
A value for |
The object being returned by the function ypinterim
can be formatted to a table using the function summary
.
Yang, S. (2018). Interim monitoring using the adaptively weighted log-rank test in clinical trials for survival outcomes. Statistics in Medicine. <doi:10.1002/sim.7958>
Yang, S., & Prentice, R. (2010). Improved logrank-type tests for survival data using adaptive weights. Biometrics, 66(1), 30-38.
Yang, S., & Prentice, R. (2005). Semiparametric analysis of short-term and long-term hazard ratios with two-sample survival data. Biometrika, 92(1), 1-17.
library(YPInterimTesting) data(virtual) time <- virtual$time event <- virtual$event group <- virtual$group spendfun <- c(1.3E-5, 4.4E-4, 0.003, 0.008) result_all <- ypinterim(time, event, group, spendfun=spendfun) result_all summary(result_all) ## The example shows how to test the package with a historical data where ## interim data at all looks are available. ## When calculating the boundary at the first look, ## the spending function value at the first look is needed: time <- virtual$time[, 1] event <- virtual$event[, 1] group <- virtual$group spendfun <- c(1.3E-5) result_look1 <- ypinterim(time, event, group, spendfun=spendfun) result_look1 summary(result_look1) ## When calculating the boundary at the second look, ## the spending function at the two looks, ## and boundary at the first look, should be supplied: time <- virtual$time[, 1:2] event <- virtual$event[, 1:2] group <- virtual$group spendfun <- c(1.3E-5, 4.4E-4) critvalue <- c(4.36) # the boundary of the first look is supplied. result_look2 <- ypinterim(time, event, group, spendfun=spendfun, critvalue = critvalue) result_look2 summary(result_look2) ## Similarly, when calculating the boundary at the third look, ## the spending function at the three looks, and boundaries ## at the first two looks, should be supplied: time <- virtual$time[, 1:3] event <- virtual$event[, 1:3] group <- virtual$group spendfun <- c(1.3E-5, 4.4E-4, 0.003) critvalue <- c(4.36, 3.42) # the boundaries at the first two looks are supplied. result_look3 <- ypinterim(time, event, group, spendfun=spendfun, critvalue = critvalue) result_look3 summary(result_look3)
library(YPInterimTesting) data(virtual) time <- virtual$time event <- virtual$event group <- virtual$group spendfun <- c(1.3E-5, 4.4E-4, 0.003, 0.008) result_all <- ypinterim(time, event, group, spendfun=spendfun) result_all summary(result_all) ## The example shows how to test the package with a historical data where ## interim data at all looks are available. ## When calculating the boundary at the first look, ## the spending function value at the first look is needed: time <- virtual$time[, 1] event <- virtual$event[, 1] group <- virtual$group spendfun <- c(1.3E-5) result_look1 <- ypinterim(time, event, group, spendfun=spendfun) result_look1 summary(result_look1) ## When calculating the boundary at the second look, ## the spending function at the two looks, ## and boundary at the first look, should be supplied: time <- virtual$time[, 1:2] event <- virtual$event[, 1:2] group <- virtual$group spendfun <- c(1.3E-5, 4.4E-4) critvalue <- c(4.36) # the boundary of the first look is supplied. result_look2 <- ypinterim(time, event, group, spendfun=spendfun, critvalue = critvalue) result_look2 summary(result_look2) ## Similarly, when calculating the boundary at the third look, ## the spending function at the three looks, and boundaries ## at the first two looks, should be supplied: time <- virtual$time[, 1:3] event <- virtual$event[, 1:3] group <- virtual$group spendfun <- c(1.3E-5, 4.4E-4, 0.003) critvalue <- c(4.36, 3.42) # the boundaries at the first two looks are supplied. result_look3 <- ypinterim(time, event, group, spendfun=spendfun, critvalue = critvalue) result_look3 summary(result_look3)
Internal functions for the YPInterimTesting package.