Treatment Switching
Overview
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.
- added summary methods for rpsftm, ipe, tsesimp, tsegest, ipcw, and msm with analysis populations, ordered TSD 24 reporting checklists, model parameter estimates, treatment effect estimates, weight summaries where applicable, and bootstrap summaries
- added matched function calls to rpsftm, ipe, tsesimp, tsegest, ipcw, and msm output; MSM summaries distinguish exclusion of post-switching data from switching models and inclusion of post-switching data in the weighted outcome model
- expanded rpsftm, ipe, tsesimp, tsegest, ipcw, and msm summaries with guidance to inspect relevant model diagnostics and plots, alongside reporting items requiring external justification or separately fitted sensitivity analyses
- added pre-filter missingness summaries for AFT-model covariates in tsesimp and switching-model covariates in tsegest, ipcw, and msm, grouped by treatment arm and relevant model candidates
- added p_kmstar to plot.ipe and added p_km_switch to plot.tsesimp and plot.tsegest
- added data_switch and km_switch to tsesimp output
- added a small positive value to avoid zero time in survival_analysis.cpp
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-04
- NOTE12 OK, 1 NOTE2026-08-01
- OK12 OK2026-04-25
- NOTE12 OK, 2 NOTE2026-04-22
- ERROR11 OK, 2 NOTE, 1 ERROR2026-04-18
Show 1 earlier changeHide 1 earlier change
- NOTE12 OK, 2 NOTE2026-03-10
Documentation
- Help pages
- 69 (32 internal)includes a package overview page
- Examples that run
- 96%24 run in a plain check · 1 only when donttest examples are enabled (R CMD check --as-cran)
- Exported functions with examples
- 100%
- Documented parameters
- 99%
- Return-value docs
- 100%
- Help pages citing references
- 25%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 20
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Issues over time
Commits over time
Commit identities over time
6 development-tooling and community-health practices detected across 4 families in the upstream repository
Checks run against github.com/kaifenglu/trtswitch on 2026-10-18.
GitHub Pages site last deployed 2026-09-26 · The repository has a site deploy workflow
pkgdown site last built 2026-09-26
Dependencies
Installing trtswitch adds 23 packages (11 with compiled code, 38 MB of source tarballs). Heaviest: BH 14 MB, ggplot2 6.0 MB, data.table 5.7 MB.
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- 0.2.8Latest
- 0.2.72026-06-25 · diff ↗
- 0.2.62026-05-26 · diff ↗
- RR 4.6.0 released · 2026-04-24
- 0.2.52026-03-13 · diff ↗
- 0.2.42026-02-12 · diff ↗
- 0.2.32026-01-10 · diff ↗ ·
removed 5 exports
bscpp, findInterval3, nscpp, qrcpp, splineDesigncppadded 2 exports
assess_phregr, zph_phregr - 0.2.22025-11-16 · diff ↗
- 0.2.12025-11-06 · diff ↗
- 0.2.0
- 0.1.92025-09-03 · diff ↗
- 0.1.8
- 0.1.7
- 0.1.62025-04-25 · diff ↗
- 0.1.5
- RR 4.5.0 released · 2025-04-11
Show 8 earlier eventsHide 8 earlier events
Package metadata
- First published
- 2024-10-17
- Total releases
- 19 / 2 yrs
- License
- GPL (>= 2) OSI
- Minimum R
- ≥ 3.5
- Bundled data
- 140 KB / 12 files
- Download size
- 621 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("trtswitch")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-21, which the citation names so these numbers can be found later. More on citing and the projects behind them.