wlrt {nphRCT}R Documentation

Weighted log-rank test

Description

This function can perform two types of weighted log-rank test, the modestly-weighted log-rank test and the Fleming-Harrington (\rho,\gamma) test, in addition to the standard log-rank test.

Usage

wlrt(
  formula,
  data,
  method,
  t_star = NULL,
  s_star = NULL,
  rho = NULL,
  gamma = NULL
)

Arguments

formula

Formula object. The response (on the left of the ~ operator) must be a survival object as returned by the Surv function. The terms (on the right of the ~ operator) must include the treatment arm indicator, and additionally can include strata using the strata function.

data

Data frame containing time-to-event data.

method

Character string specifying type of weighted log-rank test. Either "lr" for a standard log-rank test, "mw" for a modestly-weighted log-rank test, or "fh" for the Fleming-Harrington rho-gamma family.

t_star

Parameter t^* in the modestly weighted ("mw") test, see Details.

s_star

Parameter s^* in the modestly weighted ("mw") test, see Details.

rho

Parameter \rho in the Fleming-Harrington ("fh") test, see Details.

gamma

Parameter \gamma in the Fleming-Harrington ("fh") test, see Details.

Details

Select which of the three tests to perform using argument method. The output is calculated as outlined in vignette("weighted_log_rank_tests", package="wlrt").

Value

List containing the outcome of the weighted log-rank test.

In the presence of multiple strata, the results of the test on each individual strata is returned, in addition to the combined test that was proposed by Magirr and Jiménez (2022), see vignette("weighted_log_rank_tests", package="wlrt").

References

Magirr, D. (2021). Non-proportional hazards in immuno-oncology: Is an old perspective needed?. Pharmaceutical Statistics, 20(3), 512-527. doi:10.1002/pst.2091

Magirr, D. and Burman, C.F., 2019. Modestly weighted logrank tests. Statistics in medicine, 38(20), 3782-3790.

Magirr, D. and Jiménez, J. (2022) Stratified modestly-weighted log-rank tests in settings with an anticipated delayed separation of survival curves PREPRINT at https://arxiv.org/abs/2201.10445

Examples

library(nphRCT)
set.seed(1)
sim_data <- sim_events_delay(
  event_model=list(
    duration_c = 36,
    duration_e = c(6,30),
    lambda_c = log(2)/9,
    lambda_e = c(log(2)/9,log(2)/18)
  ),
  recruitment_model=list(
    rec_model="power",
    rec_period = 12,
    rec_power = 1
  ),
  n_c=50,
  n_e=50,
  max_cal_t = 36
)
#example setting t_star
wlrt(formula=Surv(event_time,event_status)~group,
  data=sim_data,
  method="mw",
  t_star = 4
)
#example setting s_star
wlrt(formula=Surv(event_time,event_status)~group,
  data=sim_data,
  method="mw",
  s_star = 0.5
)
#example with 1 strata
sim_data_0 <- sim_data
sim_data_0$ecog=0
sim_data_1 <- sim_events_delay(
  event_model=list(
    duration_c = 36,
    duration_e = c(6,30),
    lambda_c = log(2)/6,
    lambda_e = c(log(2)/6,log(2)/12)
  ),
  recruitment_model=list(
    rec_model="power",
    rec_period = 12,
    rec_power = 1
  ),
  n_c=50,
  n_e=50,
  max_cal_t = 36
)
sim_data_1$ecog=1
sim_data_strata<-rbind(sim_data_0,sim_data_1)
wlrt(formula=Surv(event_time,event_status)~group+strata(ecog),
  data=sim_data_strata,
  method="mw",
  t_star = 4
)
#example with 2 strata
sim_data_strata_2<-cbind(sim_data_strata,sex=rep(c("M","F"),times=100))
wlrt(formula=Surv(event_time,event_status)~group+strata(ecog)+strata(sex),
  data=sim_data_strata_2,
  method="mw",
  t_star = 4
)

[Package nphRCT version 0.1.0 Index]