swlrt: Stratified weighted log-rank test

Description Usage Arguments Value

View source: R/swlrt.R

Description

Stratified weighted log-rank test

Usage

1
2
3
swlrt(df, trt_colname, time_colname, event_colname, strat_colname = NULL,
  wlr = "lr", s_star = NULL, t_star = NULL, rho = NULL,
  gamma = NULL)

Arguments

df

A data frame. Assume standard structure for time-to-event data.

trt_colname

A character string. The name of the treatment column in df.

time_colname

A character string. The name of the column in df with the survival times.

event_colname

A character string. The name of the column in df with the event status. Assumes 1 means event; 0 means censored.

strat_colname

A character string. The name of the stratifying-variable column in df. Will be converted into a factor. Care is needed here – the function doesn't do any checks that there are sufficient numbers in each category.

wlr

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

s_star

This is a parameter for the "mw"-test. Either s_star or t_star must be specified. The weights are defined as w(t) = 1 / max(S(t-), s_star), where S is the Kaplan-Meier estimate in the pooled data.

t_star

This is a parameter for the "mw"-test. Either s_star or t_star must be specified. The weights are defined as w(t) = 1 / max(S(t-), S(t_star), where S is the Kaplan-Meier estimate in the pooled data.

rho

Rho parameter in the "fh"-test. The weights are defined as w(t) = S(t-)^rho (1 - S(t-))^gamma, where S is the Kaplan-Meier estimate in the pooled data.

gamma

Gamma parameter in the "fh"-test. The weights are defined as w(t) = S(t-)^rho (1 - S(t-))^gamma, where S is the Kaplan-Meier estimate in the pooled data.

Value

A list containing the overall test result and a data frame with the outcome of the weighted log-rank test in each strata. There is a column o_minus_e_trt to indicate which treatment the "obs - exp" refers to.


dominicmagirr/swlrt documentation built on Oct. 24, 2021, 11 p.m.