surv2test: Conducting Two Sample Tests with Time-To-Event Data

Description Usage Arguments Value Author(s) References Examples

View source: R/surv2test.R

Description

Performs two-sample comparisons using various tests. The current version includes the Max-Combo test and the t-year event rate difference test that were used in Horiguchi et al. (2020) <doi:10.1177/1740774520940256>. The test statistic of the Max-Combo test is the maximum of test statistics from multiple weighted log-rank tests in the G(rho,gamma) class. Specifically, they are the log-rank test (G(0,0)), the generalized Wilcoxon test (G(1,0)), and two other tests (G(0,1) and G(1,1)). For the Max-Combo test, we used a permutation resampling method to determine the null distribution of the test statistic under the null hypothesis. The t-year event rate difference test compares survival probabilities at a specific time point. All tests are two-sided where the alternative hypothesis is that treatment group is not equal to control group with respect to survival.

Usage

1
surv2test(time, status, arm, tau, nmethod=10000, seed=1)

Arguments

time

The follow-up time for right censored data.

status

The status indicator, 1=event, and 0=right censored.

arm

The group indicator for comparison. The elements of this vector take either 1 or 0. Normally, 0=control group, 1=active treatment group.

tau

A scalar value to specify the specific time point for calculating the t-year event rate difference. tau needs to be smaller than the minimum of the largest observed time in each of the two groups. When tau = NULL, the default value (i.e., the minimum of the largest observed time in each of the two groups) is used.

nmethod

A number of iterations for the resampling method. Recommended to specify at least 10000 (default) or larger.

seed

An integer value, used for the random number generation in the resampling procedures. Default is NULL.

Value

an object of class surv2test.

tau

the specific time point used for the t-year event rate differnce test

note

a note regarding the specific time point

tyear_pval

p-value of the t-year event rate difference test

maxcombo_pval

p-value of the Max-Combo test

Author(s)

Miki Horiguchi, Hajime Uno

References

Horiguchi M, Hassett MJ, Uno H. Empirical power comparison of statistical tests in contemporary phase III randomized controlled trials with time-to-event outcomes in oncology. Clinical Trials 2020. doi:10.1177/1740774520940256.

Examples

1
2
3
4
5
6
7
8
9
#--- sample data ---#
D=surv2test.sample.data()
time=D$time
status=D$status
arm=D$arm
nmethod = 100 #This is only for example use.
              #Recommended to specify at least 10000 (default) or larger.
a=surv2test(time, status, arm, tau=10, nmethod=nmethod, seed=123)
print(a)

uno1lab/surv2sampleTests documentation built on Dec. 23, 2021, 2:01 p.m.