skipTrack
skipTrack: An R package for Identifying Skips in Self-Tracked Mobile Menstrual Cycle Data - 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 1 DOI reference(s) in JOSS metadata -
○Academic publication links
-
✓Committers with academic emails
2 of 2 committers (100.0%) from academic institutions -
○Institutional organization owner
-
✓JOSS paper metadata
Published in Journal of Open Source Software
Last synced: 6 months ago
·
JSON representation
Repository
Bayesian Hierarchical Models for Identifying Non-Adherence in Mobile Menstrual Cycle Tracking
Basic Info
- Host: GitHub
- Owner: LukeDuttweiler
- License: other
- Language: R
- Default Branch: master
- Size: 728 KB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
- Releases: 2
Created about 2 years ago
· Last pushed 7 months ago
Metadata Files
Readme
Changelog
Contributing
License
README.Rmd
---
output: github_document
bibliography: 'bibliography.bib'
header-includes:
- \usepackage{amsmath}
- \usepackage{xcolor}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# skipTrack
[](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[](https://github.com/LukeDuttweiler/skipTrack/actions/workflows/R-CMD-check.yaml)
[](https://CRAN.R-project.org/package=skipTrack)
Welcome to the SkipTrack Package!
SkipTrack is a Bayesian hierarchical model for self-reported menstrual cycle length data on mobile health apps. The model is an extension of the hierarchical model presented in @li2022predictive that focuses on predicting an individual's next menstrual cycle start date while accounting for cycle length inaccuracies introduced by non-adherence in user self-tracked data. Check out the 'Getting Started' vignette to see an overview of the SkipTrack Model!
## Installation
``` r
#Install from CRAN
install.packages('skipTrack')
#Install Development Version
devtools::install_github("LukeDuttweiler/skipTrack")
```
# Package Usage
The SkipTrack package provides functions for fitting the SkipTrack model, evaluating model run diagnostics, retrieving and visualizing model results, and simulating related data. We begin our tutorial by examining some simulated data.
```{r}
library(skipTrack)
```
First, we simulate data on 100 individuals from the SkipTrack model where each observed $y_{ij}$ value has a 75% probability of being a true cycle, a 20% probability of being two true cycles recorded as one, and a 5% probability of being three true cycles recorded as one.
```{r}
set.seed(1)
#Simulate data
dat <- skipTrack.simulate(n = 100, model = 'skipTrack', skipProb = c(.75, .2, .05))
```
Fitting the SkipTrack model using this simulated data requires a call to the function `skipTrack.fit`. Note that because this is a Bayesian model and is fit with an MCMC algorithm, it can take some time with large datasets and a high number of MCMC reps and chains.
In this code we ask for 4 chains, each with 1000 iterations, run sequentially. Note that we recommend allowing the sampler to run longer than this (usually at least 5000 iterations per chain), but we use a short run here to save time.
If `useParallel = TRUE`, the MCMC chains will be evaluated in parallel, which helps with longer runs.
```{r}
ft <- skipTrack.fit(Y = dat$Y, cluster = dat$cluster,
reps = 1000, chains = 4, useParallel = FALSE)
```
Once we have the model results we are able to examine model diagnostics, visualize results from the model, and view a model summary.
### Diagnostics
Multivariate, multichain MCMC diagnostics, including traceplots, Gelman-Rubin diagnostics, and effective sample size, are all available for various parameters from the model fit. These are supplied using the `genMCMCDiag` package, see that packages' documentation for details.
Here we show the output of the diagnostics on the $c_{ij}$ parameters, which show that (at least for the $c_{ij}$ values) the algorithm is mixing effectively (or will be, once the algorithm runs a little longer).
```{r, fig.align='center', fig.width = 7, fig.height=7}
skipTrack.diagnostics(ft, param = 'cijs')
```
### Visualization
In order to see some important plots for the SkipTrack model fit, you can simply use `plot(ft)`, and the plots are directly accessible using `skipTrack.visualize(ft)`.
```{r, fig.align='center', fig.width = 7, fig.height=7}
plot(ft)
```
### Summary
A summary is available for the SkipTrack model fit with `summary(ft)`, with more detailed results accessible through `skipTrack.results(ft)`. Importantly, these results are based on a default chain burn-in value of 750 draws. This can be changed using the parameter `burnIn` for either function.
For example using `summary` with the default burnIn...
```{r, eval=FALSE}
summary(ft)
```
produces the following output:
```{r, echo = FALSE}
summary(ft)
```
On the other hand if we change the burnIn to 500...
```{r, eval = FALSE}
summary(ft, burnIn = 500)
```
we see:
```{r, echo = FALSE}
summary(ft, burnIn = 500)
```
This introduction provides enough information to start fitting the SkipTrack model. For further information regarding different methods of simulating data, additional model fitting, and tuning parameters for fitting the model, please see the help pages and the 'Getting Started' vignette. Additional vignettes are forthcoming.
\newpage
## Bibliography
Owner
- Login: LukeDuttweiler
- Kind: user
- Repositories: 1
- Profile: https://github.com/LukeDuttweiler
JOSS Publication
skipTrack: An R package for Identifying Skips in Self-Tracked Mobile Menstrual Cycle Data
Published
September 16, 2024
Volume 9, Issue 101, Page 6928
Authors
Luke Duttweiler
Department of Biostatistics, Harvard T.H. Chan School of Public Health, Boston, MA, United States
Department of Biostatistics, Harvard T.H. Chan School of Public Health, Boston, MA, United States
Tags
menstrual cycle Bayesian hierarchical model MCMCGitHub Events
Total
- Issues event: 2
- Push event: 4
Last Year
- Issues event: 2
- Push event: 4
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| LukeDuttweiler | l****6@h****u | 77 |
| LukeDuttweiler | l****r@h****u | 42 |
Committer Domains (Top 20 + Academic)
hsph.harvard.edu: 1
houghton.edu: 1
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 1
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 1
- Total pull request authors: 0
- Average comments per issue: 0.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 1
- Pull request authors: 0
- Average comments per issue: 0.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- LukeDuttweiler (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 184 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 2
- Total maintainers: 1
cran.r-project.org: skipTrack
A Bayesian Hierarchical Model that Controls for Non-Adherence in Mobile Menstrual Cycle Tracking
- Homepage: https://github.com/LukeDuttweiler/skipTrack
- Documentation: http://cran.r-project.org/web/packages/skipTrack/skipTrack.pdf
- License: MIT + file LICENSE
-
Latest release: 0.1.2
published about 1 year ago
Rankings
Dependent packages count: 28.9%
Dependent repos count: 35.6%
Average: 49.9%
Downloads: 85.2%
Maintainers (1)
Last synced:
6 months ago
Dependencies
DESCRIPTION
cran
- Rcpp * depends
- LaplacesDemon * imports
- doParallel * imports
- foreach * imports
- genMCMCDiag >= 0.2.0 imports
- ggplot2 * imports
- glmnet * imports
- optimg * imports
- parallel * imports
- stats * imports
- utils * imports
.github/workflows/R-CMD-check.yaml
actions
- actions/checkout v4 composite
- r-lib/actions/check-r-package v2 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/draft-pdf.yml
actions
- actions/checkout v4 composite
- actions/upload-artifact v4 composite
- openjournals/openjournals-draft-action master composite