Description Usage Arguments Details Value Examples
Max-combo is a class of multiple combination tests. This function considers the maximum of multiple weighted log-rank tests, i.e. z_maxcombo = max(z1, z2, ..., zk), where zi is the weighted log-rank test statistic with weight function wi. This function calculates the p-value and associated statistics when performing the max-combo test. The weight function wi can be the flexible Stabilized Fleming-Harrington class sFH(rho, gamma, tau, s.tau), or any user-defined weight function.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | wlr.maxcombo(
time = c(5, 7, 10, 12, 12, 15, 20, 20),
event = c(1, 0, 0, 1, 1, 0, 1, 1),
group = c(0, 1, 0, 1, 0, 1, 0, 1),
strata1 = NULL,
strata2 = NULL,
strata3 = NULL,
rho = c(0, 0, 0),
gamma = c(0, 0.5, 1),
tau = NULL,
s.tau = c(0, 0, 0.5),
f.ws = list(lr = function(s) { return(1) }, fh005 = function(s) { sqrt(1 - s)
}, sfh01 = function(s) { 1 - apply(cbind(s, 0.5), MARGIN = 1, FUN = max) }),
side = c("two.sided", "one.sided")
)
|
time |
Survival time |
event |
Event indicator; 1 = event, 0 = censor |
group |
Treatment group; 1 = experimental group, 0 = control |
strata1 |
Stratification variable 1 |
strata2 |
Stratification variable 2 |
strata3 |
Stratification variable 3 |
rho |
A vector of rho parameters for Fleming-Harrington (rho, gamma) weighted log-rank tests. |
gamma |
A vector of gamma parameters for Fleming-Harrington (rho, gamma) weighted log-rank tests. For log-rank test, set rho = gamma = 0. |
tau |
A vector of cut points for stabilized FH test, sFH(rho, gamma, tau); with weight function defined as w(t) = s_tilda^rho*(1-s_tilda)^gamma, where s_tilda = max(s(t), s.tau) or max(s(t), s(tau)) if s.tau = NULL tau = Inf reduces to regular Fleming-Harrington test(rho, gamma) |
s.tau |
A vector of survival rate cuts S(tau) at t = tau; default 0.5, ie. cut at median. s.tau = 0 reduces to regular Fleming-Harrington test(rho, gamma) |
f.ws |
Self-defined weight functions of survival rate. For example, f.ws=list( lr = function(s)return(1), fh005=function(s)sqrt(1-s), sfh01=function(s)1-apply(cbind(s, 0.5),MARGIN=1,FUN=max) ) defines 3 weighted log-rank tests: log-rank, FH(0, 0.5), and sFH(0, 1, s.tau=0.5) When f.ws is specified, the weight function takes it as priority. Note: The actual math formula for weighting function is based on the left of each event time t, i.e., w(t) = f.ws(s(t-)). For FH(rho, gamma) test, when gamma = 0, then the first event time has weight 1; when gamma > 0, the first event weight is 0. This can ensure consistency with FH(0,0) = logrank; and FH(1,0) = generalized Wilcoxon. |
side |
Type of test. one.sided or two.sided. default = two.sided |
Refer to Karrinson (2016) for the method of max-combo when it is defined based on FH(0, 0), FH(1, 0), FH(0, 1) and FH(1, 1). However, this function extends the concept to include any type of weighted log-rank tests. The kth weighted log-rank test has parameters of (rho_k, gamma_k, tau_k, s.tau_k) defined in the stabilized Fleming-Harrington class (He et al 2021) or user-defined weight function f.ws_k, for k = 1, ..., K. For the stabilized Fleming-Harrington class, specify either tau or s.tau, which are thresholds in survival time and survival rate, respectively. In addition, the weight function is estimated within each strata. One-sided test is more appropriate in maxcombo test.
dataframe including the following variables:
time: Survival time
event: Event indicator; 0 = censor; 1 = event
group: Group indicator; 0 = control; 1 = experimental treatment
strata1; Strata 1
strata2; Strata 2
strata3; Strata 3
Correlation matrix of weighted log-rank tests
dataframe including the following variables:
rho: Stabilized Fleming-Harrington test parameter
gamma: Stabilized Fleming-Harrington test parameter
tau: Stabilized Fleming-Harrington test parameter if provided
s.tau: Stabilized Fleming-Harrington test parameter if provided
test.side: 1 or 2
z: Normalized weighted log-rank z statistics
z.max: maximum of weighted log-rank test statistics(1-sided test)
abs.z.max maximum of absolute values of weighted log-rank test statistics (2-sided tests)
p: P value
Weight function(s) used in the calculation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | #Example (1) Stratified max-combo test including 3 weighted log-rank test statistics:
#log-rank, FH(0, 0.5), and sFH(0, 1, tau=0.5).
time=rexp(100); event=sample(c(0,1), 100, replace = TRUE);
group=c(rep(0, 50), rep(1, 50));
strata1=sample(c(1,2), 100, replace = TRUE)
strata2=sample(c(1,2), 100, replace = TRUE)
strata3=sample(c(3,4), 100, replace = TRUE)
rho = c(0,0,0); gamma=c(0,0.5,1); tau = NULL; s.tau=c(0, 0, 0.5);
f.ws=list(
lr = function(s){return(1)},
fh005=function(s){sqrt(1-s)},
sfh01=function(s){1-apply(cbind(s, 0.5),MARGIN=1,FUN=max)}
)
side = c("one.sided")
wlr.maxcombo(time=time, event=event, group=group, strata1=strata1,
strata2=strata2, strata3=strata3, rho=rho, gamma=gamma,
tau = tau, s.tau=s.tau, f.ws=f.ws, side = side)
#Equivalent to
wlr.maxcombo(time=time, event=event, group=group, strata1=strata1,
strata2=strata2, strata3=strata3, rho=rho, gamma=gamma,
tau = tau, s.tau=s.tau, f.ws=NULL, side = side)
#Example (2) If there is only 1 weighted log-rank test, max-combo reduces to weighted log-rank test
#FH01 test
wlr.maxcombo(time=time, event=event, group=group, strata1=strata1,
strata2=strata2, strata3=strata3, rho=0, gamma=1,
tau = NULL, s.tau=0, f.ws=NULL, side = side)
#equivalent to
wlr(time=time, event=event, group=group, strata1=strata1,
strata2=strata2, strata3=strata3, rho=0, gamma=1,
tau = NULL, s.tau=0, f.ws=NULL, side = side)
#Example (3) maxcombo of (logrank, FH01, FH11)
wlr.maxcombo(time=time, event=event, group=group, strata1=strata1,
strata2=strata2, strata3=strata3, rho=c(0,0,1), gamma=c(0,1,1),
tau = NULL, s.tau=c(0,0,0), f.ws=NULL, side = side)
#Example (4) maxcombo of (logrank, FH01)
wlr.maxcombo(time=time, event=event, group=group, strata1=strata1,
strata2=strata2, strata3=strata3, rho=c(0,0), gamma=c(0,1),
tau = NULL, s.tau=c(0,0), f.ws=NULL, side = side)
#Example (5) maxcombo of (logrank, modestly logrank)
wlr.maxcombo(time=time, event=event, group=group, strata1=strata1,
strata2=strata2, strata3=strata3, rho=NULL, gamma=NULL,
tau = NULL, s.tau=NULL, f.ws=list(
lr = function(s){1},
mlr = function(s){1/apply(cbind(s, 0.5),MARGIN=1,FUN=max)}), side = side)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.