Package: trtswitch 0.2.7

trtswitch: 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.

Authors:Kaifeng Lu [aut, cre]

trtswitch_0.2.7.tar.gz
trtswitch_0.2.7.zip(r-4.7)trtswitch_0.2.7.zip(r-4.6)trtswitch_0.2.7.zip(r-4.5)
trtswitch_0.2.7.tgz(r-4.6-x86_64)trtswitch_0.2.7.tgz(r-4.6-arm64)trtswitch_0.2.7.tgz(r-4.5-x86_64)trtswitch_0.2.7.tgz(r-4.5-arm64)
trtswitch_0.2.7.tar.gz(r-4.7-arm64)trtswitch_0.2.7.tar.gz(r-4.7-x86_64)trtswitch_0.2.7.tar.gz(r-4.6-arm64)trtswitch_0.2.7.tar.gz(r-4.6-x86_64)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
trtswitch/json (API)

# Install 'trtswitch' in R:
install.packages('trtswitch', repos = c('https://kaifenglu.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/kaifenglu/trtswitch/issues

Pkgdown/docs site:https://kaifenglu.github.io

Uses libs:
  • c++– GNU Standard C++ Library v3
Datasets:
  • adsl - Baseline subject-level data
  • adtdc - Longitudinal time-dependent covariate data
  • aml - Acute myelogenous leukemia survival data from the survival package
  • heart - Stanford heart transplant data from the survival package
  • immdef - Simulated CONCORDE trial data from the rpsftm package
  • ingots - The binary data from Cox and Snell (1989, pp. 10-11).
  • liver - The liver data used in SAS PROC PHREG documentation examples.
  • rawdata - A simulated time-to-event data set with 10 replications
  • sexagg - Urinary tract infection data from the logistf package
  • shilong - The randomized clinical trial SHIVA data in long format from the ipcwswitch package
  • six - The repeated measures data from the "Six Cities" study of the health effects of air pollution (Ware et al. 1984).
  • tobin - Tobin's tobit data from the survival package

On CRAN:

Conda:

cpp

6.76 score 2 stars 42 scripts 644 downloads 25 exports 23 dependencies

Last updated from:e9d6fd4543. Checks:12 OK, 1 FAIL. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK344
linux-devel-x86_64OK376
source / vignettesOK514
linux-release-arm64OK365
linux-release-x86_64OK366
macos-release-arm64OK251
macos-release-x86_64OK623
macos-oldrel-arm64OK238
macos-oldrel-x86_64OK420
windows-develOK355
windows-releaseOK422
windows-oldrelOK361
wasm-releaseFAIL173

Exports:assess_phregripcwipekmdiffkmestliferegrlogisregrlrtestmsmphregrpreptdcrecensor_sim_rpsftmresiduals_liferegrresiduals_phregrrmdiffrmestrpsftmsurvfit_phregrsurvQuantilesurvsplittsegesttsegestsimtsesimptssimzph_phregr

Dependencies:BHclicowplotcpp11data.tablefarverggplot2gluegtableisobandlabelinglifecycleR6RColorBrewerRcppRcppParallelRcppThreadrlangS7scalesvctrsviridisLitewithr

Iterative Parameter Estimation
Introduction | Estimation of $\psi$ | Estimation of Hazard Ratio | Concorde Trial Example | Potential Convergence Issues

Last update: 2026-01-09
Started: 2024-10-30

Rank Preserving Structural Failure Time Models
Introduction | Recensoring | Common Treatment Effect Assumption | Estimation of $\psi$ | Estimation of Hazard Ratio | Concorde Trial Example | Data | Analysis

Last update: 2026-01-09
Started: 2024-10-30

Simple Two-Stage Estimation
Introduction | Estimation of $\psi$ | Estimation of Hazard Ratio | Example

Last update: 2026-01-09
Started: 2024-10-30

Inverse Probability of Censoring Weights
Introduction | Estimation of weights | Pooled Logistic Regression Model | Proportional Hazards Model | Stabilized Weights | Truncation of Weights | Estimation of Hazard Ratio | Example for Pooled Logistic Regression Switching Model | Example for Time-Dependent Cox Switching Model

Last update: 2026-01-07
Started: 2024-10-30

Marginal Structural Model
Introduction | Estimation of weights | Stabilized Weights | Truncation of Weights | Estimation of Hazard Ratio | Example for Pooled Logistic Regression Switching Model

Last update: 2026-01-07
Started: 2025-06-26

Two-Stage Estimation With g-estimation
Introduction | Estimation of $\psi$ | Key Components | Estimation of Hazard Ratio | Example

Last update: 2026-01-07
Started: 2024-10-30

Readme and manuals

Help Manual

Help pageTopics
Treatment Switchingtrtswitch-package
Baseline subject-level dataadsl
Longitudinal time-dependent covariate dataadtdc
Acute myelogenous leukemia survival data from the survival packageaml
Assess Proportional Hazards Assumption Based on Supremum Testassess_phregr
Stanford heart transplant data from the survival packageheart
Simulated CONCORDE trial data from the rpsftm packageimmdef
The binary data from Cox and Snell (1989, pp. 10-11).ingots
Inverse Probability of Censoring Weights (IPCW) for Treatment Switchingipcw
Iterative Parameter Estimation (IPE) for Treatment Switchingipe
Estimate of Milestone Survival Differencekmdiff
Kaplan-Meier Estimates of Survival Curvekmest
Parametric Regression Models for Failure Time Dataliferegr
The liver data used in SAS PROC PHREG documentation examples.liver
Logistic Regression Models for Binary Datalogisregr
Log-Rank Test of Survival Curve Differencelrtest
Marginal Structural Model (MSM) for Treatment Switchingmsm
Proportional Hazards Regression Modelsphregr
Prepare Survival Data With Time-Dependent Covariatespreptdc
A simulated time-to-event data set with 10 replicationsrawdata
Simulation Study to Evaluate Recensoring Rules in RPSFTMrecensor_sim_rpsftm
Residuals for Parametric Regression Models for Failure Time Dataresiduals_liferegr
Residuals for Proportional Hazards Regression Modelsresiduals_phregr
Estimate of Restricted Mean Survival Time Differencermdiff
Estimate of Restricted Mean Survival Timermest
Rank Preserving Structural Failure Time Model (RPSFTM) for Treatment Switchingrpsftm
Urinary tract infection data from the logistf packagesexagg
The randomized clinical trial SHIVA data in long format from the ipcwswitch packageshilong
The repeated measures data from the "Six Cities" study of the health effects of air pollution (Ware et al. 1984).six
Survival Curve for Proportional Hazards Regression Modelssurvfit_phregr
Brookmeyer-Crowley Confidence Interval for Quantiles of Right-Censored Time-to-Event DatasurvQuantile
Tobin's tobit data from the survival packagetobin
Two-Stage Estimation with g-Estimation (TSEgest) for Treatment Switchingtsegest
Simulate Survival Data for Two-Stage Estimation with g-estimationtsegestsim
Simple Two-Stage Estimation (TSEsimp) for Treatment Switchingtsesimp
Simulate Data for Treatment Switchingtssim
Assess Proportional Hazards Assumption Based on Scaled Schoenfeld Residualszph_phregr