Learn R Programming

trtswitch (version 0.2.2)

Treatment Switching

Description

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.

Copy Link

Version

Install

install.packages('trtswitch')

Monthly Downloads

477

Version

0.2.2

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Kaifeng Lu

Last Published

November 16th, 2025

Functions in trtswitch (0.2.2)

heart

Stanford heart transplant data from the survival package
ipcw

Inverse Probability of Censoring Weights (IPCW) for Treatment Switching
ipe

Iterative Parameter Estimation (IPE) for Treatment Switching
bscpp

B-Spline Basis for Polynomial Splines
adtdc

Longitudinal time-dependent covariate data
lrtest

Log-Rank Test of Survival Curve Difference
kmdiff

Estimate of Milestone Survival Difference
nscpp

Natural Cubic Spline Basis
kmest

Kaplan-Meier Estimates of Survival Curve
aml

Acute myelogenous leukemia survival data from the survival package
logisregr

Logistic Regression Models for Binary Data
liferegr

Parametric Regression Models for Failure Time Data
phregr

Proportional Hazards Regression Models
msm

Marginal Structural Model (MSM) for Treatment Switching
plot.msm

Plot method for msm objects
preptdc

Prepare Survival Data With Time-Dependent Covariates
plot.ipe

Plot method for ipe objects
plot.tsesimp

Plot method for tsesimp objects
plot.ipcw

Plot method for ipcw objects
plot.tsegest

Plot method for tsegest objects
print.ipe

Print method for ipe objects
print.liferegr

Print liferegr Object
print.msm

Print method for msm objects
print.logisregr

Print logisregr Object
plot.rpsftm

Plot method for rpsftm objects
residuals_phregr

Residuals for Proportional Hazards Regression Models
print.ipcw

Print method for ipcw objects
print.phregr

Print phregr Object
print.tsegest

Print method for tsegest objects
print.tsesimp

Print method for tsesimp objects
print.rpsftm

Print method for rpsftm objects
qrcpp

QR Decomposition of a Matrix
rawdata

A simulated time-to-event data set with 10 replications
rmdiff

Estimate of Restricted Mean Survival Time Difference
rmest

Estimate of Restricted Mean Survival Time
rpsftm

Rank Preserving Structural Failure Time Model (RPSFTM) for Treatment Switching
survfit_phregr

Survival Curve for Proportional Hazards Regression Models
survQuantile

Brookmeyer-Crowley Confidence Interval for Quantiles of Right-Censored Time-to-Event Data
splineDesigncpp

B-Spline Design Matrix
six

The repeated measures data from the "Six Cities" study of the health effects of air pollution (Ware et al. 1984).
shilong

The randomized clinical trial SHIVA data in long format from the ipcwswitch package
sexagg

Urinary tract infection data from the logistf package
survsplit

Split a survival data set at specified cut points
recensor_sim_rpsftm

Simulation Study to Evaluate Recensoring Rules in RPSFTM
trtswitch-package

Treatment Switching
tsegestsim

Simulate Survival Data for Two-Stage Estimation with g-estimation
tsesimp

Simple Two-Stage Estimation (TSEsimp) for Treatment Switching
residuals_liferegr

Residuals for Parametric Regression Models for Failure Time Data
tsegest

Two-Stage Estimation with g-Estimation (TSEgest) for Treatment Switching
tssim

Simulate Data for Treatment Switching
tobin

Tobin's tobit data from the survival package
immdef

Simulated CONCORDE trial data from the rpsftm package
adsl

Baseline subject-level data
findInterval3

Find Interval Numbers of Indices
ingots

The binary data from Cox and Snell (1989, pp. 10-11).