Skip to contents

maxcombo_test() compares the survival of two groups with several Fleming-Harrington weighted log-rank tests at once and takes the largest absolute standardized statistic. It keeps good power whether the difference between the groups is early, late, or constant over time, which makes it a common choice when the hazards may not be proportional, such as with a delayed treatment effect.

Usage

maxcombo_test(
  formula,
  data,
  weights,
  subset,
  na.action = stats::na.omit,
  rho = c(0, 1, 0, 1),
  gamma = c(0, 0, 1, 1)
)

Arguments

formula

A formula with a Surv() response on the left and a grouping variable with two groups on the right, such as Surv(time, status) ~ sex. A strata() term stratifies each of the tests.

data

A data frame holding the variables in formula.

weights

Optional case weights, a column of data or a numeric vector.

subset

An optional expression selecting the rows of data to use.

na.action

What to do with rows that have missing values. The default drops them.

rho, gamma

Numeric vectors of the same length, at least 0, giving the weight functions.

Value

A maxcombo_test object with the statistic (the largest \(|Z_i|\)), the p_value, z (a data frame of rho, gamma, and z for each weight function), correlation (the correlation matrix of the statistics), and method. as.data.frame() gives the test as a one-row data frame.

Details

Each pair of rho[i] and gamma[i] defines one weight function, as in logrank_test(). The default four are the log-rank test (0, 0), early emphasis (1, 0), late emphasis (0, 1), and middle emphasis (1, 1). The standardized statistics \(Z_i\) for the first group are jointly normal under the null hypothesis, with a correlation that follows from the shared risk sets. The p-value is \(P(\max_i |Z_i| \ge T)\) for the observed maximum \(T\), computed from that multivariate normal distribution by deterministic quasi-Monte Carlo integration (accurate to about 4 decimal places).

References

Lee, S.-H. (2007). On the versatility of the combination of the weighted log-rank statistics. Computational Statistics & Data Analysis, 51(12), 6557-6564.

Examples

lung <- data.frame(
  time = c(306, 455, 1010, 210, 883, 1022, 310, 361, 218, 166, 170, 654),
  status = c(2, 2, 1, 2, 2, 1, 2, 2, 2, 2, 2, 2),
  sex = c(1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2)
)
maxcombo_test(Surv(time, status) ~ sex, data = lung)
#> <maxcombo_test> Surv(time, status) ~ sex
#> MaxCombo test of (0, 0), (1, 0), (0, 1), (1, 1)
#> 
#>  rho gamma         z
#>    0     0 -1.833008
#>    1     0 -1.622214
#>    0     1 -1.772501
#>    1     1 -1.589221
#> 
#> max |z| = 1.833, p = 0.125

# Only the log-rank and late-emphasis weights
maxcombo_test(Surv(time, status) ~ sex, data = lung, rho = c(0, 0), gamma = c(0, 1))
#> <maxcombo_test> Surv(time, status) ~ sex
#> MaxCombo test of (0, 0), (0, 1)
#> 
#>  rho gamma         z
#>    0     0 -1.833008
#>    0     1 -1.772501
#> 
#> max |z| = 1.833, p = 0.1