Treatment Switching

Implements rank preserving structural failure time model (RPSFTM), iterative parameter estimation (IPE), inverse probability of censoring weights (IPCW), marginal structural model (MSM), simple two-stage estimation (TSEsimp), and improved two-stage estimation with g-estimation (TSEgest) methods for treatment switching in randomized clinical trials.


trtswitch

trtswitch provides methods for treatment switching adjustment in randomized clinical trials, including:

  • rank preserving structural failure time model (RPSFTM)
  • iterative parameter estimation (IPE)
  • inverse probability of censoring weights (IPCW)
  • marginal structural model (MSM)
  • simple two-stage estimation (TSEsimp)
  • improved two-stage estimation with g-estimation (TSEgest)

Installation

Install from GitHub:

# install.packages("remotes")
remotes::install_github("kaifenglu/trtswitch")

Example: RPSFTM

library(trtswitch)
library(dplyr)

# Build treatment exposure proportion used by rpsftm
# in the one-way switching example dataset.
data <- immdef %>%
  mutate(rx = 1 - xoyrs / progyrs)

fit <- rpsftm(
  data = data,
  id = "id",
  time = "progyrs",
  event = "prog",
  treat = "imm",
  rx = "rx",
  censor_time = "censyrs",
  boot = FALSE
)

fit

# Key estimates
fit$psi
fit$hr
fit$psi_CI
fit$hr_CI

Documentation

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("trtswitch")

0.2.8 by Kaifeng Lu, 14 days ago


https://kaifenglu.github.io/trtswitch/, https://github.com/kaifenglu/trtswitch


Report a bug at https://github.com/kaifenglu/trtswitch/issues


Browse source code at https://github.com/cran/trtswitch


Authors: Kaifeng Lu [aut, cre]


Documentation:   PDF Manual  


GPL (>= 2) license


Imports Rcpp, RcppParallel, parallel, rlang, data.table, ggplot2, cowplot

Suggests testthat, dplyr, tidyr, survival, knitr, rmarkdown, pkgdown

Linking to Rcpp, RcppParallel, RcppThread, BH

System requirements: C++17


See at CRAN