rpsft {lrstat}R Documentation

Rank preserving structured failure time model (RPSFTM) for treatment switching

Description

Obtains the causal parameter estimate of the RPSFTM from the log-rank test and the hazard ratio estimate from the Cox model.

Usage

rpsft(
  data,
  stratum = "stratum",
  time = "time",
  event = "event",
  treat = "treat",
  rx = "rx",
  censor_time = "censor_time",
  base_cov = "none",
  low_psi = -1,
  hi_psi = 1,
  n_eval_z = 100L,
  alpha = 0.05,
  treat_modifier = 1,
  recensor = 1L,
  autoswitch = 1L,
  gridsearch = 0L,
  boot = 0L,
  n_boot = 1000L
)

Arguments

data

The input data frame that contains the following variables:

  • stratum: The stratum.

  • time: The survival time for right censored data.

  • event: The event indicator, 1=event, 0=no event.

  • treat: The randomized treatment indicator, 1=treatment, 0=control.

  • rx: The proportion of time on active treatment.

  • censor_time: The administrative censoring time. It should be provided for all subjects including those who had events.

  • base_cov: The values of baseline covariates. This is the full-rank design matrix (excluding treat) for the Cox model, assuming that factor variables have already been expanded into dummy variables.

stratum

The name of the stratum variable in the input data.

time

The name of the time variable in the input data.

event

The name of the event variable in the input data.

treat

The name of the treatment variable in the input data.

rx

The name of the rx variable in the input data.

censor_time

The name of the censor_time variable in the input data.

base_cov

The vector of names of baseline covariates (excluding treat) in the input data.

low_psi

The lower limit of the causal parameter of RPSFTM.

hi_psi

The upper limit of the causal parameter of RPSFTM.

n_eval_z

The number of points between low_psi and hi_psi at which to evaluate the log-rank Z-statistics.

alpha

The significance level to calculate confidence intervals.

treat_modifier

The optional sensitivity parameter for the constant treatment effect assumption.

recensor

Whether to apply recensoring to counter-factual survival times. Defaults to TRUE.

autoswitch

Whether to exclude recensoring for treatment arms with no switching. Defaults to TRUE.

gridsearch

Whether to use grid search to estimate the causal parameter psi. Defaults to FALSE, in which case, a root finding algorithm will be used.

boot

Whether to use bootstrap to obtain the confidence interval for hazard ratio. Defaults to FALSE, in which case, the confidence interval will be constructed to match the log-rank test p-value.

n_boot

The number of bootstrap samples.

Details

We use the following steps to obtain the hazard ratio estimate and confidence interval had there been no treatment switching:

Value

A list with the following components:

Author(s)

Kaifeng Lu, kaifenglu@gmail.com

Examples


library(dplyr)

data <- immdef %>% mutate(rx = 1-xoyrs/progyrs)

fit <- rpsft(data, time = "progyrs", event = "prog", treat = "imm",
             rx = "rx", censor_time = "censyrs", boot = 0)

c(fit$hr, fit$hr_CI)


[Package lrstat version 0.2.9 Index]