Package: rsmart 0.1.0

Cole Manschot

rsmart: Sequential Multiple Assignment Randomized Trials Design and Analyses

Implements the interim augmented inverse probability weighted estimator (IAIPWE) for estimating the value of treatment regimes embedded in sequential multiple assignment randomized trials (SMARTs). The IAIPWE subsumes both the inverse probability weighted estimator (IPWE) and the augmented inverse probability weighted estimator (AIPWE), enabling inference at interim and final analyses. The package provides functions for value estimation, sandwich variance computation, group sequential stopping boundaries, and sample size determination for multi-stage SMARTs with up to two treatment options at each stage. See Manschot, Laber, and Davidian (2023) <doi:10.1111/biom.13854> for additional details.

Authors:Cole Manschot [aut, cre], Tabitha Peter [ctb], Gabriela Piasecki [ctb], Laura Frederick [ctb]

rsmart_0.1.0.tar.gz
rsmart_0.1.0.zip(r-4.7-any)rsmart_0.1.0.zip(r-4.6-any)rsmart_0.1.0.zip(r-4.5-any)
rsmart_0.1.0.tgz(r-4.6-any)rsmart_0.1.0.tgz(r-4.5-any)
rsmart_0.1.0.tar.gz(r-4.7-any)rsmart_0.1.0.tar.gz(r-4.6-any)
rsmart_0.1.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION
card.svg |card.png
rsmart/json (API)

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

Bug tracker:https://github.com/msdllcpapers/rsmart/issues

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

Datasets:
  • pcsttrial - Pcsttrial: Simulated Clinical Trial Data for Pain Coping Skills Training

On CRAN:

Conda:

5.00 score 1 stars 5 scripts 345 downloads 23 exports 16 dependencies

Last updated from:e61a52e847. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK144
source / vignettesOK182
linux-releaseOK127
macos-releaseOK148
macos-oldrelOK126
windows-develOK106
windows-releaseOK107
windows-oldrelOK106
wasm-releaseOK87

Exports:block_randestimate_valuesgen_no_trt_respget_anget_bnget_boundsget_bounds_chiget_first_boundget_kappaget_next_boundget_nuget_q_coefsget_q_fitsget_sample_sizeget_sample_size_chiiaipwepi_fitspstepqstepregime_list_no_trt_respsim_treatmentsmart_designvalue_terms

Dependencies:codetoolsdata.tabledigestdoFutureforeachfuturefuture.applyglobalsiteratorslatticelistenvMASSMatrixmodelObjmvtnormparallelly

Simulating SMART designs with sim_treatment
Introduction | Design 1: No response status | Simulation | Design 2: Only non-responders are re-randomized | Design 3: Both responders and non-responders re-randomized | Note on ordering and block randomization

Last update: 2026-09-21
Started: 2026-07-31

Full demo of IAIPWE
Introduction | An example SMART | The sample data | Computing the IPWE | Computing the AIPWE | Computing the IAIPWE | References

Last update: 2026-07-31
Started: 2026-07-31

Getting Started with SMARTs
What are SMARTs? | Why use a SMART? | When are SMARTs appropriate? | Where our package comes in

Last update: 2026-07-31
Started: 2026-07-31

pkg_architecture
1. User-Facing Entry Points | 2. Nuisance Parameter Estimation (called by iaipwe) | 3. Value Estimation (called by iaipwe) | 4. Sandwich Variance — $B_n$ (empirical variance of estimating equations) | 5. Sandwich Variance — $A_n$ (derivative of estimating equations) | 6. Trial Design Utilities (standalone)

Last update: 2026-07-31
Started: 2026-07-31

Readme and manuals

Help Manual

Help pageTopics
Create a blocked randomization functionblock_rand
Estimate values for all treatment regimesestimate_values
Generate sample data for a two-stage SMART where responders are not re-randomizedgen_no_trt_resp
Compute the An matrix for the sandwich variance estimatorget_an
Compute the Bn matrix for the sandwich variance estimatorget_bn
Compute all stopping boundaries for a two-analysis group sequential designget_bounds
Compute the first chi-squared stopping boundary for a group sequential designget_bounds_chi
Compute the first stopping boundary for a group sequential designget_first_bound
Compute the kappa (stage reached) for each individualget_kappa
Compute subsequent stopping boundaries for a group sequential designget_next_bound
Estimate stage arrival probabilities (nu)get_nu
Extract coefficients from all fitted Q-function modelsget_q_coefs
Fit outcome regression (Q-function) models across all stages for a single regimeget_q_fits
Determine sample size for a group sequential SMART designget_sample_size
Determine sample size for a chi-squared global test in a group sequential SMART designget_sample_size_chi
IAIPWE for K-stage SMARTs with up to 2 treatment options at each stageiaipwe
pcsttrial: Simulated Clinical Trial Data for Pain Coping Skills Trainingpcsttrial
Fit propensity score models for all stagespi_fits
Fit a propensity score model for a single stagepstep
Fit an outcome regression (Q-function) model for a single stageqstep
Generate regime lists for a two-stage SMART where responders are not re-randomizedregime_list_no_trt_resp
Simulate treatment assignments for a single stagesim_treatment
Compute stopping boundaries and sample size for a group sequential SMARTsmart_design
Compute the individual-level value terms for a single regimevalue_terms