Short course: Using brms to fit linear mixed models


Instructor

Shravan Vasishth

Dates and location

Taught at Goettingen, 27-28 June 2019.


Prerequisites

I will assume familiarity with R and lmer.

Please install the following software before coming to the course

We will be using the latest versions of R, and RStudio, so make sure you install these on your computer. You should also install the R package rstan; the R package brms.

Outcomes

After completing this workshop, participant will have become familiar with some of the nuts and bolts details of Bayesian linear mixed models using brms. They will know how to calibrate their models using prior and posterior predictive checks; they will be able to establish true and false discovery rates to validate discovery claims, and to carry out model comparison using Bayes factors.

Course materials

These are part of a longer course on Bayesian data analysis. Some slides may seem out of context, but I will fill in the details just in time.

slides:
  1. Linear Mixed Models using brms
    1. fake data generation function
    2. 04.01 Exercises, 04.02 Exercises
  2. 05 Model Comparison using Bayes Factors
    1. 05 code from slides
    1. 05.01 Exercises
I will add a new exercise specifically for the Goettingen group, using their own data.

case studies: Three case studies (zip archive): meta-analysis, measurement error models, and example of pre-registration.

Additional readings

Tutorial articles
  1. brms tutorial for phonetics/phonology, Vasishth, Nicenboim, Beckman, Li, Kong. An easy read.
  2. brms tutorial by the author of the package, Paul Buerkner Written by the author of brms.
  3. Ordinal regression models in psychological research: A tutorial, by Buerkner and Vuorre Answers a FAQ about linear mixed models.
  4. Bayesian workflow tutorial, by Schad, Betancourt, Vasishth Applies Betancourt's ideas to psycholinguistics.
  5. Linear mixed models tutorial, Sorensen, Hohenstein, VasishthAn introduction to LMMs using Stan.
Books on Bayesian data analysis
Read these if you want to become more familiar with Bayesian methods per se.
  1. A Student's Guide to Bayesian Statistics, by Ben Lambert: A good, non-technical introduction to Stan and Bayesian modeling.
  2. Statistical Rethinking, by Richard McElreath: A classic introduction.
  3. Doing Bayesian Data Analysis, Second Edition: A Tutorial with R, JAGS, and Stan, By John Kruschke: A good introduction specifically for psychologists.
Some example articles from our lab that use Bayesian methods
  1. Example random-effects meta-analysis.
  2. Example of finite mixture models using Stan.
  3. Replication attempt of a published study.
  4. Bayesian analysis of relatively large-sample psycholinguistic experiment.
There are many more articles that use Bayesian methods, see my home page (under publications).