The {simswjm} package can be used to simulate data from stepped wedge trials with a continuous, binary, or count longitudinal outcome. Moreover, data can be simulated assuming both non-informative and informative dropout, with the dropout mechanism according to a joint longitudinal-survival model with shared random effects or (loosely) based on a mixed effects logistic regression model.
This package is a companion to the manuscript titled “Analysis of cohort stepped wedge cluster-randomized trials with non-ignorable dropout via joint modeling”, which is currently submitted for publication. A pre-print is available on arXiv.
You can install the development version of {simswjm} from GitHub with:
# install.packages("remotes")
remotes::install_github("RedDoorAnalytics/simswjm")
Example code to fit mixed-effects and joint models using the simulated
data is included within this repository as well, in the
testing/
folder. Specifically, models are fit using the gsem
command in Stata
for continuous, binary, count outcomes; more details in this
file.
If you find this useful, please cite it in your work:
citation("simswjm")
#> To cite package 'simswjm' in publications use:
#>
#> Gasparini A, Crowther MJ, Hoogendijk EO, Li F, Harhay MO (2024).
#> "Analysis of cohort stepped wedge cluster-randomized trials with
#> non-ignorable dropout via joint modeling." 2404.14840,
#> <https://arxiv.org/abs/2404.14840>.
#>
#> A BibTeX entry for LaTeX users is
#>
#> @Misc{,
#> title = {Analysis of cohort stepped wedge cluster-randomized trials with non-ignorable dropout via joint modeling},
#> author = {Alessandro Gasparini and Michael J. Crowther and Emiel O. Hoogendijk and Fan Li and Michael O. Harhay},
#> year = {2024},
#> eprint = {2404.14840},
#> archiveprefix = {arXiv},
#> primaryclass = {stat.ME},
#> url = {https://arxiv.org/abs/2404.14840},
#> }
If you have any questions or feedback on the package or experience any bugs, please file an issue on GitHub.