Learn R Programming

trtswitch (version 0.2.0)

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 with g-estimation (TSEgest) methods for treatment switching in randomized clinical trials.

Copy Link

Version

Install

install.packages('trtswitch')

Monthly Downloads

400

Version

0.2.0

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Kaifeng Lu

Last Published

October 6th, 2025

Functions in trtswitch (0.2.0)

print.liferegr

Print liferegr Object
lrtest

Log-Rank Test of Survival Curve Difference
logisregr

Logistic Regression Models for Binary Data
nscpp

Natural Cubic Spline Basis
msm

Marginal Structural Model (MSM) Method for Treatment Switching
preptdc

Prepare Survival Data With Time-Dependent Covariates
phregr

Proportional Hazards Regression Models
liferegr

Parametric Regression Models for Failure Time Data
kmdiff

Estimate of Milestone Survival Difference
kmest

Kaplan-Meier Estimates of Survival Curve
print.phregr

Print phregr Object
residuals_liferegr

Residuals for Parametric Regression Models for Failure Time Data
qrcpp

QR Decomposition of a Matrix
rpsftm

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

Simulation Study to Evaluate Recensoring Rules in RPSFTM
rmest

Estimate of Restricted Mean Survival Time
rawdata

A simulated time-to-event data set with 10 replications
print.logisregr

Print logisregr Object
rmdiff

Estimate of Restricted Mean Survival Time Difference
residuals_phregr

Residuals for Proportional Hazards Regression Models
survQuantile

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

Treatment Switching
tsegest

The Two-Stage Estimation (TSE) Method Using g-estimation for Treatment Switching
splineDesigncpp

B-Spline Design Matrix
survfit_phregr

Survival Curve for Proportional Hazards Regression Models
survsplit

Split a survival data set at specified cut points
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
sexagg

Urinary tract infection data from the logistf package
tssim

Simulate Data for Treatment Switching
tsesimp

The Simple Two-Stage Estimation (TSE) Method for Treatment Switching
tsegestsim

Simulate Survival Data for Two-Stage Estimation Method Using g-estimation
shilong

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

Longitudinal time-dependent covariate data
ipe

Iterative Parameter Estimation (IPE) for Treatment Switching
bscpp

B-Spline Basis for Polynomial Splines
ipcw

Inverse Probability of Censoring Weights (IPCW) Method for Treatment Switching
ingots

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

Simulated CONCORDE trial data from the rpsftm package
findInterval3

Find Interval Numbers of Indices
aml

Acute myelogenous leukemia survival data from the survival package
heart

Stanford heart transplant data from the survival package
adsl

Baseline subject-level data