This repository contains the code and statistically-related write-ups for the ANIMO randomized controlled trial pilot study, a gender- and culturally-sensitive weight loss intervention for hispanic males.
The main results of this trial are published in two papers:
D.O. Garcia, L.A. Valdez, M.L. Bell, K. Humphrey, M. Hingle, M. McEwen, & S.P. Hooker (2018). A Gender- and Culturally-Sensitive Weight Loss Intervention for Hispanic Males: The ANIMO Randomized Controlled Trial Study Protocol and Recruitment Methods. Contemporary Clinical Trials Communications. https://doi.org/10.1016/j.conctc.2018.01.010. In press.
D.O. Garcia, L.A. Valdez, B. Aceves, D. Campas, J. Loya, K. Humphrey, M.L. Bell, M. Hingle, M. McEwen, & S.P. Hooker (2018). A Gender- and Culturally-Sensitive Weight Loss Intervention for Hispanic Males: The ANIMO Randomized Controlled Trial Study Efficacy Outcomes. In progress.
The project was tested on macOS 10.13.4 High Sierra using the following:
- R version 3.4.4
- The R packages pacman, tidyverse, lme4, Gmisc, htmlTable, docopt, and rmarkdown
- GNU Make 3.81 - standard on macOS and Linux
- GNU Bash 3.2.57(1) - default shell in terminal on macOS and many Linux distributions
You can ensure you have the required R packages by running the following in an R console:
# Install pacman, if needed
if (!suppressWarnings(require("pacman", quietly = TRUE))) {
install.packages("pacman", repo = "https://cran.rstudio.com")
}
# Load docopt, install if not installed
pacman::p_load(docopt)The magic of the pacman R package will then install any other required packages as they are needed.
Unfortunately, our data are not publicly available. If you are a study collaborator with access to the REDCap project, you can use the next section to obtain the data stored in REDCap.
To download the data from REDCap, you will need an API token from the REDCap projects "ANIMO", "Screening forms - ANIMO", and "ANIMO - blood test data". The Makefile expects these tokens to be in a directory called "tokens", so create a directory in the main project directory (i.e., animo/), called "tokens". In this directory, create plain text files with the file extension ".token" which contain only a single line with each token. For example, I created three files called "animo.token", "screen.token", and "blood.token", and I copied and pasted the corresponding token in each. The stem of what you name the token files (e.g., "animo") will become the stem of your data files (e.g., "animo.csv").
First, download the project files (e.g., by hitting the "Clone or download" button above).
Then navigate to the main directory of the project (called animo by default) in a terminal window. Typing make help when in the main project directory displays a short description of all of the options to make. For example, the previous two steps might look like:
cd ~/Downloads/animo
make helpTo make the randomization list, for instance, type
make randomizewhen in the animo directory.
The Makefile expects the raw data to be in a directory called data-raw (automatically created if you download the data from REDCap via Make).
Running make all (or simply make) will produce the following:
- A directory called "data-processed" with cleaned data files
- A directory called "results" with R files for the models, and the formatted results documents.
- A directory called "methods" with the randomization list and formatted statistical analysis plan.
- A directory called "cache" with cached results from the Rmarkdown files.