wlrt: Weighted log-rank test

View source: R/wlrt.R

wlrtR Documentation

Weighted log-rank test

Description

Weighted log-rank test

Usage

wlrt(df, trt_colname, time_colname, event_colname, 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.

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 data frame. The outcome of the weighted log-rank test. There is a column o_minus_e_trt to indicate which treatment the "obs - exp" refers to.


dominicmagirr/gsdelayed documentation built on May 15, 2024, 8:24 a.m.