wlr: Fleming-Harrington Weighted Logrank Tests

View source: R/wlr.R

wlrR Documentation

Fleming-Harrington Weighted Logrank Tests

Description

With output from the function counting_process

Usage

wlr(
  x = sim_pw_surv(n = 200) %>% cut_data_by_event(150) %>% counting_process(arm =
    "Experimental"),
  rg = tibble(rho = c(0, 0, 1, 1), gamma = c(0, 1, 0, 1)),
  returnVariance = FALSE
)

Arguments

x

a counting_process-class tibble with a counting process dataset

rg

a tibble with variables rho and gamma, both greater than equal to zero, to specify one Fleming-Harrington weighted logrank test per row; Default: tibble(rho = c(0, 0, 1, 1), gamma = c(0, 1, 0, 1))

returnVariance

a logical flag that, if true, adds columns estimated variance for weighted sum of observed minus expected; see details; Default: FALSE

Details

The input value x produced by counting_process() produces a counting process dataset grouped by strata and sorted within strata by increasing times where events occur.

  • Z - standardized normal Fleming-Harrington weighted logrank test

  • i - stratum index

  • d_i - number of distinct times at which events occurred in stratum i

  • t_{ij} - ordered times at which events in stratum i, j=1,2,\ldots d_i were observed; for each observation, t_{ij} represents the time post study entry

  • O_{ij.} - total number of events in stratum i that occurred at time t_{ij}

  • O_{ije} - total number of events in stratum i in the experimental treatment group that occurred at time t_{ij}

  • N_{ij.} - total number of study subjects in stratum i who were followed for at least duration

  • E_{ije} - expected observations in experimental treatment group given random selection of O_{ij.} from those in stratum i at risk at time t_{ij}

  • V_{ije} - hypergeometric variance for E_{ije} as produced in Var from the counting_process() routine

  • N_{ije} - total number of study subjects in stratum i in the experimental treatment group who were followed for at least duration t_{ij}

  • E_{ije} - expected observations in experimental group in stratum i at time t_{ij} conditioning on the overall number of events and at risk populations at that time and sampling at risk observations without replacement:

    E_{ije} = O_{ij.} N_{ije}/N_{ij.}

  • S_{ij} - Kaplan-Meier estimate of survival in combined treatment groups immediately prior to time t_{ij}

  • \rho, \gamma - real parameters for Fleming-Harrington test

  • X_i - Numerator for signed logrank test in stratum i

    X_i = \sum_{j=1}^{d_{i}} S_{ij}^\rho(1-S_{ij}^\gamma)(O_{ije}-E_{ije})

  • V_{ij} - variance used in denominator for Fleming-Harrington weighted logrank tests

    V_i = \sum_{j=1}^{d_{i}} (S_{ij}^\rho(1-S_{ij}^\gamma))^2V_{ij})

    The stratified Fleming-Harrington weighted logrank test is then computed as:

    Z = \sum_i X_i/\sqrt{\sum_i V_i}

Value

a tibble with rg as input and the FH test statistic for the data in x (Z, a directional square root of the usual weighted logrank test); if variance calculations are specified (e.g., to be used for covariances in a combination test), the this will be returned in the column Var

Examples

library(tidyr)
# Use default enrollment and event rates at cut at 100 events
x <- sim_pw_surv(n = 200) %>%
  cut_data_by_event(100) %>%
  counting_process(arm ="Experimental")
# compute logrank (FH(0,0)) and FH(0,1)
wlr(x, rg = tibble(rho = c(0, 0), gamma = c(0, 1)))


keaven/simtrial documentation built on April 17, 2023, 4:03 a.m.