Package 'YPInterimTesting'

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

Help Index


virtual Data Set for the example

Description

This virtual data set is created to show how to use the package.

Usage

data(virtual)

Format

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).

See Also

ypinterim

Examples

library(YPInterimTesting)
data(virtual)
time <- virtual$time
colnames(time) # Check the order of the column names.
head(time)

Interim Monitoring Using Adaptively Weighted Log-rank Test in Clinical Trials

Description

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.

Details

Package: YPInterimTesting
Type: Package
Version: 1.0.0
Date: 2018-10-31
License: GPL (>= 3)

Author(s)

Daewoo Pak and Song Yang

References

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.

See Also

ypinterim


The main function of the package performing the adaptively weighted log-rank test for interim monitoring

Description

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).

Usage

## Default S3 method:
ypinterim(time, event, group, spendfun, critvalue = NULL,
  repnum = 1E4, bound = 50, seed.fix = 0, ...)

Arguments

...

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 time (event = 1, censored = 0). The dimension of the matrix should be equivalent to that of time.

group

A numeric vector of the group indicator (treatment = 1, control = 0).

spendfun

A numeric vector of the values for the spending function α(t)\alpha(t). Must be user-specified.

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 ii-th look, i>1i>1, when the user supplies the data and the values of the spending function at the ii looks, as well as the previous i1i-1 critical values that have already been obtained, the package provides the stopping boundary, the test statistics value and the nominal p-values at the iith look, and display results for all ii looks.

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 (-bound, bound) for estimating the parameters in the short-term and long-term hazard ratio model (Yang and Prentice, 2005). These parameters are β1\beta_1 and β2\beta_2 in their notations. The default boundary is (50,50)(-50, 50).

seed.fix

A value for set.seed. The default value is 0. Should be FALSE or a numeric number.

Details

The object being returned by the function ypinterim can be formatted to a table using the function summary.

References

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.

Examples

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 Interim Monitoring Using Adaptively Weighted Log-rank Test in Clinical Trials

Description

Internal functions for the YPInterimTesting package.