"SARA is a mobile application to increase or sustain engagement of substance data collection overtime." (Rabbi and others, 2018) A micro-randomized trial (MRT) was conducted to assess the effectiveness of employing various engagement strategies integrated with the mobile application.
This repository contains code for performing curation and analysis of SARA MRT data and documentation. Files corresponding to particular stages of the project are placed under the relevant header.
Questions about the material in this repository can be directed at https://github.com/jamieyap/SARA/issues by submitting a New issue
.
File | Description |
---|---|
SARA_documentation.pdf | Documents data curation |
display-results.pdf | Displays estimates of marginal and moderated causal effects |
check-randomization.pdf | Describes checks on quality of randomization of the SARA MRT |
sara-tables-main.pdf | Displays summary statistics on availability and missing data |
File | Description |
---|---|
create-outcome-variable.R | Construct outcome variables |
create-intervention-variable.R | Construct variables for randomization assignment and availability for intervention |
create-appusage-variable.R | Construct control variable: app usage in the past X hours from time T |
create-contact-variable.R | Construct control variable: any contact by study staff in the past X hours from time T |
create-other-variables.R | Construct other variables |
merge-data-frames.R | Merge variables into one data frame in preparation for data analysis |
File | Description |
---|---|
test-file-01.R | A collection of tests checking whether input data are as expected |
test-file-02.R | A collection of tests checking whether data curation was performed as planned |
run-test-file.R | Runs test-file.R and requires the R package testthat (Wickham, 2011). test-file.R can be run with testthat version 2.2.1 |
File | Description |
---|---|
check-randomization.Rmd | Check quality of randomization and visualize availability and missing data over time. These are displayed in check-randomization.pdf |
sara-tables-main.Rmd | Calculate summary statistics on availability for intervention and missing data. These are displayed in sara-tables-main.pdf |
File | Description |
---|---|
data-analysis-complete-case.R | Specify marginal and moderated causal effects to estimate using complete case data |
data-analysis-multiple-imputation.R | Specify marginal and moderated causal effects to estimate using multiply imputed data |
primary_and_secondary_analysis.R | Estimate moderated treatment effect and their standard errors |
display-results.Rmd | Display results from analysis using data-analysis-complete-case.R and data-analysis-multiple-imputation.R in display-results.pdf |
display-sensitivity.Rmd | Displays results of sensitivity analysis using data-analysis-complete-case.R in display-sensitivity.pdf. Analyses are analogous to those described in display-results.pdf |
File | Description |
---|---|
data-manip-utils.R | Contains functions to perform data manipulation tasks |
io-utils.R | Contains functions to perform input/output tasks |
main-utils.R | Contains functions to perform data analysis tasks |
file-check-utils.R | Contains functions to compare different files and sets of files between different folders |
create-user-specific-environ.R | Create an .Renviron file where names of file paths are stored |
-
Rabbi M, Meredith P, Predrag K, Erin B, Inbal N, Maureen W, Murphy S. SARA - Substance Abuse Research Assistant. Open Science Framework. 2017 Oct 22; doi: 10.17605/OSF.IO/VWZMD.
-
Rabbi, M., Philyaw Kotov, M., Cunningham, R., Bonar, E. E., Nahum-Shani, I., Klasnja, P., ... Murphy, S. (2018). Toward Increasing Engagement in Substance Use Data Collection: Development of the Substance Abuse Research Assistant App and Protocol for a Microrandomized Trial Using Adolescents and Emerging Adults. JMIR research protocols, 7(7), e166. doi:10.2196/resprot.9850
-
Wickham H (2011). "testthat: Get Started with Testing." The R Journal, 3, 5-10. https://journal.r-project.org/archive/2011-1/RJournal_2011-1_Wickham.pdf.