Skip to contents

The K-group weighted log-rank statistic \(U^\top V^{-1} U\) on \(K - 1\) degrees of freedom, with weights \(w_j = 1\) (log-rank), \(\hat S(t_j-)\) (Peto-Peto, as survival::survdiff(rho = 1)), \(n_j\) (Gehan-Wilcoxon) or \(\sqrt{n_j}\) (Tarone-Ware).

Usage

morie_weighted_logrank(
  time,
  event,
  group,
  weights = c("logrank", "peto", "gehan", "tarone")
)

Arguments

time

Follow-up times.

event

Event indicator.

group

Group labels (two or more).

weights

One of "logrank", "peto", "gehan", "tarone".

Value

list with statistic, df, p_value, weights.

References

Peto R, Peto J (1972). Asymptotically efficient rank invariant test procedures. JRSS A, 135(2), 185-207. Tarone RE, Ware J (1977). On distribution-free tests for equality of survival distributions. Biometrika, 64(1), 156-160.

Examples

morie_weighted_logrank(c(2, 3, 3, 5, 8, 9, 4, 6), c(1, 1, 0, 1, 0, 1, 1, 0),
                       c(0, 0, 0, 0, 1, 1, 1, 1), weights = "peto")$statistic
#> [1] 2.840336