/jasa-repro-template

Repository containing JASA Reproducibility templates

Primary LanguageHTML

JASA Sharing Reproducible Materials over Github

Directory structure

The repo has the following directory structure.

## 
## project directory
##   |-- acc_form.Rmd
##   |  o-- object of type(s):file
##   |-- jasa-repro-template.Rproj
##   |  o-- object of type(s):file
##   |-- README.Rmd
##   |  o-- object of type(s):file
##   |-- README.md
##   |  o-- object of type(s):file
##   |-- analysis/
##   |  o-- object of type(s):dir
##   |-- data/
##   |  o-- object of type(s):dir
##   |-- manuscript/
##   |  o-- object of type(s):dir
##   |-- output/
##   |  o-- object of type(s):dir
##   |-- preprocessing/
##   |  o-- object of type(s):dir
##   o-- revn/
##      o-- object of type(s):dir

Each of the files and subdirectories in this repository are described below.

  • README.Rmd/md: Read me explaining how to reproduce materials in this repository
  • acc_form.Rmd/html: Reproducibility checklist (not currently complete)
  • analysis/
    • 202112_dataAnalysis.Rmd/.html: Code/output for processing raw paw trajectory data and generating Figures 1, 6, and 7 in the manuscript.
    • 202112_simulation_results.Rmd/.html: Code/output for processing simulation results and generating Figures 2, 3, 4, and 5 in the manuscript.
  • data/: Raw paw trajectory data (not currently included)
  • manuscript/: manuscript files including .Rmd template
  • output/: Figures, data analysis, and simulation results
    • *.png: Figures from the manuscript
    • px_results.RData: Data analysis x-axis results from flode model, executed by running 202112_dataAnalysis.Rmd.
    • py_results.RData: Data analysis y-axis results.
    • pz_results.RData: Data analysis z-axis results.
    • simulation_results/
      • *.RDA: Output from simulation scenarios executed by running scripts in ../preprocessing/simulations.
  • preprocessing/: Source files for executing core modeling code, generating simulated data, and running simulations
    • estimate_flode.R: Defines function for estimating flode model using EM algorithm
    • make_pffr.R: Defines function for running functional historical regression model and processing surfaces for visualization
    • search_alpha.R: Defines function to perform grid search over possible α0 values to choose best initial value.
    • simulated_paw.R: Defines function for simulating data.
    • utils.R: Defines helper functions called in the estimate_flode.R file.
    • simulations/: File for generating simulation results across all simulation scenarios.
      • 20211227_simulations_flodeVSfhist.R: Compares flode and functional historical regression across 9 alpha values for 30 datasets each.
      • 20211228_simulations_flode.R: Evaluates flode across 4 sample sizes and 3 alpha values for 30 datasets each.

Workflow

Describe file structure and workflow here

  • Slow steps are cached or saved as R data objects that are read in the next time a file is run- this makes it faster to run the Rmarkdown files that generate analysis results
  1. Execute the file 202112_simulation_results.Rmd to create Figures 2, 3, 4 and 5 and save them as .png files in the output folder.

  2. Execute the file 202112_dataAnalysis.Rmd to create Figures 1, 6, and 7 and save them as .png files in the output folder. Also creates and saves to output a dataframe of computation times and parameter values that are reported as part of inline text in the manuscript.Rmd. This allows all inline R code from the manuscript.Rmd to be fully reproducible (not entered by hand).

  3. To generate the manuscript knit the file manuscript.Rmd in the manuscript folder. This does not execute the full analysis but reads in figures and numbers in the output folder generated by knitting 202112_simulation_results.Rmd and 202112_dataAnalysis.Rmd.

Other thoughts

  • easily could have this same format whether manuscripts are generated using R Markdown or Latex
  • probably best to have users clone the repo rather than fork it so they can rename it?