digital-wellbeing / gametime-longitudinal

Data and code required to reproduce all analyses reported in our manuscript, Time spent playing video games is unlikely to impact well-being (Vuorre, Johannes, Magnusson, & Przybylski, 2021).
https://digital-wellbeing.github.io/gametime-longitudinal
Creative Commons Attribution 4.0 International
6 stars 0 forks source link
psychology r statistics video-games

Longitudinal study of game play and well-being

This repository (GitHub / OSF) contains the data and code required to reproduce all analyses reported in our manuscript, Time spent playing video games is unlikely to impact well-being (Vuorre, Johannes, Magnusson, & Przybylski, 2021). These analyses are presented in the Online analysis supplement.

Materials

In addition to raw data, the repository contains many survey and telemetry variables that we did not analyse, but that may be of interest to further analyses of gameplay and well being.

Reproducibility

The raw data are in the Data/ directory of this repository. The code that we used to clean and analyse the data are organised in R Markdown (.Rmd) files in this directory, which are meant to be run in the sequence indicated by their numeric prefixes. To run all the cleaning and analyses, and compile the resulting document (the online analysis supplement), run bookdown::render_book() in R or click "Build Book" in the RStudio IDE.

Docker

To ensure the reproducibility of our analyses, you can use Docker:

Build the Docker image

docker build \
    --build-arg R_VERSION=4.1.1 \
    --build-arg RENV_VERSION=0.14.0 \
    -t gametime-longitudinal .

Run the container and render output. Note you may adjust MAX_CORES to use more cores to speed up computations.

docker run \
    --rm \
    -v "$(pwd):/home/" \
    -v "/home/renv/library" \
    -e MAX_CORES=1 \
    gametime-longitudinal \
    R -e 'renv::restore(prompt = FALSE); bookdown::render_book()'