snSMART
snSMART: An R Package for Small Sample, Sequential, Multiple Assignment, Randomized Trial Data Analysis - Published in JOSS (2024)
Science Score: 95.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 4 DOI reference(s) in README and JOSS metadata -
✓Academic publication links
Links to: joss.theoj.org -
✓Committers with academic emails
4 of 14 committers (28.6%) from academic institutions -
○Institutional organization owner
-
✓JOSS paper metadata
Published in Journal of Open Source Software
Keywords
bayesian-analysis
clinical-trials
r
rare-disease
small-sample
Last synced: 7 months ago
·
JSON representation
Repository
small n sequential multiple assignment randomized trial (snSMART)
Basic Info
Statistics
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 2
- Releases: 1
Topics
bayesian-analysis
clinical-trials
r
rare-disease
small-sample
Created almost 5 years ago
· Last pushed over 1 year ago
Metadata Files
Readme
Contributing
License
Code of conduct
README.Rmd
---
output: github_document
---
# snSMART

[](https://github.com/sidiwang/snSMART/actions/workflows/R-CMD-check.yaml)


[](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
[](https://www.repostatus.org/)
[](https://app.codecov.io/gh/sidiwang/snSMART?branch=main)
[](https://doi.org/10.21105/joss.06971)
The aim of the **snSMART** R package is to consolidate data simulation, sample size calculation and analysis functions for several snSMART (small sample sequential, multiple assignment, randomized trial) designs under one library.
An snSMART is a multi-stage trial design where for a two-stage design, randomization in the second stage depends on the outcome to first stage treatment. snSMART designs require that the same outcome is measured at the end of the first stage and at the end of the second stage. Additionally, the length of the first stage of the trial must be the same amount of time as the length for the second stage. snSMARTs are motivated by obtaining more information from a small sample of individuals with the primary goal to identify the superior first stage treatment or dosage level using both stages of data. Data are shared across the two stages of the snSMART design to more precisely estimate the effect of the treatments given in the first stage.
## Installation
Before using this package, please install the [JAGS library](https://sourceforge.net/projects/mcmc-jags/) on your device.
You can install the snSMART package from CRAN:
```{r}
install.packages("snSMART", repos = "http://cran.us.r-project.org")
library(snSMART)
```
Or get the development version from GitHub:
```{r echo = TRUE, eval = FALSE}
# Install devtools first if you haven't done so
library(devtools)
# install snSMART
devtools::install_github("sidiwang/snSMART")
library(snSMART)
```
## snSMART designs and functions covered in this package
* snSMART with binary outcome (3 active treatments or placebo and 2 dose level, non-responders re-randomized)
+ Bayesian Joint Stage Model (BJSM) analysis function - `BJSM_binary`
+ Log Poisson Joint Stage Model (JSRM) analysis function - `JSRM_binary`
+ sample size calculation function - `sample_size`
+ Group Sequential snSMART BJSM analysis function - `group_seq`
* snSMART with mapping function (3 active treatments, re-randomization depends on continuous outcome at stage 1; continuous outcomes)
+ BJSM analysis function - `BJSM_c`
## Example
`BJSM_binary`:
We call the `BJSM_binary` function using data from an snSMART with 30 total individuals. We assumed a six beta model with the priors for $\pi_A, \pi_B$ and $\pi_C$ being $Beta(0.4, 1.6)$, the prior for $\beta_{0m}$ being $Beta(1.6, 0.4)$, and the prior for $\beta_{1m}$ being $Pareto(3, 1)$. The coverage probability for credible intervals is set to 0.95, and the expected response rate of DTR will also be calculated.
```{r}
mydata <- data_binary
BJSM_result <- BJSM_binary(
data = mydata, prior_dist = c("beta", "beta", "pareto"),
pi_prior = c(0.4, 1.6, 0.4, 1.6, 0.4, 1.6), beta_prior = c(1.6, 0.4, 3, 1),
n_MCMC_chain = 1, n.adapt = 1000, MCMC_SAMPLE = 20, ci = 0.95,
six = TRUE, DTR = TRUE, verbose = FALSE
)
summary(BJSM_result)
```
`LPJSM_binary`:
Here, we call the LPJSM_binary mirroring our example for the BJSM_binary above.
```{r}
LPJSM_result <- LPJSM_binary(data = data_binary, six = TRUE, DTR = TRUE)
summary(LPJSM_result)
```
`sample_size`:
In this example, we call the function to request the sample size needed per arm with the following assumptions: the response rates for treatments A, B, and C are 0.7, 0.5 and 0.25, respectively; $\beta_1$ is assumed to be 1.4; $\beta_0$ is assumed to be 0.5; the coverage rate for the posterior difference of top two treatments is set to 0.9; the ‘power’ is set to 0.8; the prior sample size is 4 for treatment A, 2 for treatment B and 3 for treatment C; the prior means are 0.65 for treatment A, 0.55 for treatment B and 0.25 for treatment C
```{r}
sampleSize <- sample_size(
pi = c(0.7, 0.5, 0.25), beta1 = 1.4, beta0 = 0.5,
coverage = 0.9, power = 0.8, mu = c(0.65, 0.55, 0.25),
n = c(4, 2, 3)
)
```
`group_seq`:
This function either outputs which treatment arm should be dropped if \code{interim = TRUE} or provides a full BJSM analysis based on the complete dataset if \code{interim = FALSE}. The dataset \code{groupseqDATA\_look1} and \code{groupseqDATA\_full} are provided in the \pkg{snSMART} package for illustration purpose.
```{r}
result1 <- group_seq(
data = groupseqDATA_look1, interim = TRUE, drop_threshold_pair = c(0.5, 0.4),
prior_dist = c("beta", "beta", "pareto"), pi_prior = c(0.4, 1.6, 0.4, 1.6, 0.4, 1.6),
beta_prior = c(1.6, 0.4, 3, 1), MCMC_SAMPLE = 6000, n.adapt = 1000, n_MCMC_chain = 1
)
```
```{r}
result2 <- group_seq(
data = groupseqDATA_full, interim = FALSE, prior_dist = c("beta", "beta", "pareto"),
pi_prior = c(0.4, 1.6, 0.4, 1.6, 0.4, 1.6), beta_prior = c(1.6, 0.4, 3, 1),
MCMC_SAMPLE = 60000, BURN.IN = 10000, n_MCMC_chain = 1, ci = 0.95, DTR = TRUE
)
summary(result2)
```
`BJSM_c`:
Below, we call the function assuming the mean and standard deviation of the normal prior being 50 and 50 for all three treatments, and the standard deviation of the prior distribution of $\phi_3$ being 20. The number of MCMC chain is set to 1 with 1,000 adaptation iterations and 5,000 total iterations.
```{r}
BJSM_result <- BJSM_c(
data = trialDataMF, xi_prior.mean = c(50, 50, 50), xi_prior.sd = c(50, 50, 50),
phi3_prior.sd = 20, n_MCMC_chain = 1, n.adapt = 1000, MCMC_SAMPLE = 5000, BURN.IN = 1000,
ci = 0.95, n.digits = 5
)
summary(BJSM_result)
```
This R package will continue to be updated as more snSMART designs and methods are developed. We hope that this package translates snSMART design and methods into finding more effective treatments for rare disease.
## References
Chao, Y.C., Trachtman, H., Gipson, D.S., Spino, C., Braun, T.M. and Kidwell, K.M., 2020. Dynamic treatment regimens in small n, sequential, multiple assignment, randomized trials: An application in focal segmental glomerulosclerosis. Contemporary clinical trials, 92, p.105989.
Chao, Y.C., Braun, T.M., Tamura, R.N. and Kidwell, K.M., 2020. A Bayesian group sequential small n sequential multiple‐assignment randomized trial. Journal of the Royal Statistical Society: Series C (Applied Statistics), 69(3), pp.663-680.
Fang, F., Hochstedler, K.A., Tamura, R.N., Braun, T.M. and Kidwell, K.M., 2021. Bayesian methods to compare dose levels with placebo in a small n, sequential, multiple assignment, randomized trial. Statistics in Medicine, 40(4), pp.963-977.
Hartman, H., Tamura, R.N., Schipper, M.J. and Kidwell, K.M., 2021. Design and analysis considerations for utilizing a mapping function in a small sample, sequential, multiple assignment, randomized trials with continuous outcomes. Statistics in Medicine, 40(2), pp.312-326.
Wei, B., Braun, T.M., Tamura, R.N. and Kidwell, K., 2020. Sample size determination for Bayesian analysis of small n sequential, multiple assignment, randomized trials (snSMARTs) with three agents. Journal of Biopharmaceutical Statistics, 30(6), pp.1109-1120.
Wei, B., Braun, T.M., Tamura, R.N. and Kidwell, K.M., 2018. A Bayesian analysis of small n sequential multiple assignment randomized trials (snSMARTs). Statistics in medicine, 37(26), pp.3723-3732.
Owner
- Login: sidiwang
- Kind: user
- Location: Ann Arbor
- Company: University of Michigan
- Website: https://sidiwang.net
- Repositories: 10
- Profile: https://github.com/sidiwang
PhD Student in Biostatistics
JOSS Publication
snSMART: An R Package for Small Sample, Sequential, Multiple Assignment, Randomized Trial Data Analysis
Published
September 12, 2024
Volume 9, Issue 101, Page 6971
Authors
Roy Tamura
University of South Florida
University of South Florida
Tags
rare disease clinical trial snSMART BayesianGitHub Events
Total
- Fork event: 1
Last Year
- Fork event: 1
Committers
Last synced: 8 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Sidi Wang | s****g@u****u | 100 |
| Sidi Wang | s****g@S****l | 65 |
| Michael Kleinsasser | m****a@u****u | 6 |
| Sidi Wang | s****g@v****u | 6 |
| Michael Kleinsasser | mk@M****l | 4 |
| Sidi Wang | s****g@0****t | 3 |
| Øystein Sørensen | o****n@h****m | 2 |
| Sidi Wang | s****g@0****t | 2 |
| Michael Kleinsasser | mk@M****e | 2 |
| Michael Kleinsasser | mk@0****t | 2 |
| Sidi Wang | s****g@v****u | 1 |
| Sidi Wang | s****g@0****t | 1 |
| Sidi Wang | s****g@0****t | 1 |
| Sidi Wang | s****g@0****t | 1 |
Committer Domains (Top 20 + Academic)
umich.edu: 2
0587307043.wireless.umich.net: 1
0587670402.vpn.umich.net: 1
0587671413.vpn.umich.net: 1
v-foreseer-local-mitc.d-mitc-2.umnet.umich.edu: 1
0587448753.wireless.umich.net: 1
michaels-mbp-4.home: 1
0587384591.wireless.umich.net: 1
0587670770.vpn.umich.net: 1
v-foreseer-local-mitc.d-mitc-1.umnet.umich.edu: 1
Issues and Pull Requests
Last synced: 7 months ago
All Time
- Total issues: 2
- Total pull requests: 36
- Average time to close issues: N/A
- Average time to close pull requests: about 1 hour
- Total issue authors: 2
- Total pull request authors: 3
- Average comments per issue: 5.5
- Average comments per pull request: 0.03
- Merged pull requests: 30
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 2
- Pull requests: 14
- Average time to close issues: N/A
- Average time to close pull requests: 25 minutes
- Issue authors: 2
- Pull request authors: 2
- Average comments per issue: 5.5
- Average comments per pull request: 0.07
- Merged pull requests: 13
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- aghaynes (1)
- ezraporter (1)
Pull Request Authors
- sidiwang (44)
- osorensen (4)
- mkleinsa (3)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 239 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 5
- Total maintainers: 1
cran.r-project.org: snSMART
Small N Sequential Multiple Assignment Randomized Trial Methods
- Homepage: https://github.com/sidiwang/snSMART
- Documentation: http://cran.r-project.org/web/packages/snSMART/snSMART.pdf
- License: GPL-2 | GPL-3 [expanded from: GPL (≥ 2)]
-
Latest release: 0.2.4
published over 1 year ago
Rankings
Forks count: 28.8%
Dependent packages count: 29.8%
Stargazers count: 35.2%
Dependent repos count: 35.5%
Average: 41.6%
Downloads: 78.5%
Maintainers (1)
Last synced:
7 months ago
Dependencies
DESCRIPTION
cran
- R >= 3.4.0 depends
- EnvStats * imports
- HDInterval * imports
- bayestestR * imports
- condMVNorm * imports
- cubature * imports
- geepack * imports
- magrittr * imports
- pracma * imports
- rjags * imports
- rmutil * imports
- tidyr * imports
- truncdist * imports
- coda * suggests
.github/workflows/R-CMD-check.yaml
actions
- actions/checkout v3 composite
- r-lib/actions/check-r-package v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml
actions
- actions/checkout v4 composite
- actions/upload-artifact v4 composite
- codecov/codecov-action v4 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
