mvuorre / workshop

Workshop in applied stats topics
https://mvuorre.github.io/workshop
Creative Commons Attribution 4.0 International
1 stars 3 forks source link

brms workshop

Matti Vuorre

Plan

We plan to tackle some or all of the topics below:

  1. Collaboration and workflow
  2. Multilevel models: Priors, outcome distributions, and model comparison
  3. Ordinal models
  4. Signal Detection Theoretic models
  5. Censored models

Our plan is to walk through (some of) them, and edit the code to address your questions.

Materials

The materials of this workshop are organized in Quarto files. The source code is on GitHub.

Prerequisites

We assume some familiarity with basic statistical modeling and the R language. If you’d like a refresher, see Introduction to Modern Statistics & R for Data Science. To follow along, you need to have

Build / reproduce

Note that building the project will run all the analysis documents, which involve bayesian models: This will take a long time. Because of this, you should first create an .Renviron file to describe your system settings (see .Renviron.example). For example,

echo "
MAX_CORES = 8
BRMS_BACKEND = "cmdstanr"
BRMS_THREADS = 2
BRMS_ITER = 1000
" >> .Renviron

Then, to recreate the materials locally, run the following in your terminal, not R. This will download the workshop materials (all source code), and then run the required code.

git clone https://github.com/mvuorre/workshop.git
cd brms-workshop.git
make # (requires GNU Make)

If you don’t have make installed (i.e. you are on Windows), you need to first restore the R environment, prepare the data, and then render the project:

R -e 'renv::restore(prompt = FALSE)'
Rscript prepare-data.R
quarto render

Contribute

Issues & pull requests at https://github.com/mvuorre/workshop are welcome.