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:
- Linear Mixed Models using brms
- fake data generation function
- 04.01 Exercises,
04.02 Exercises
- 05 Model Comparison using Bayes Factors
- 05 code from slides
- 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
-
brms tutorial for phonetics/phonology, Vasishth, Nicenboim, Beckman, Li, Kong. An easy read.
-
brms tutorial by the author of the package, Paul Buerkner Written by the author of brms.
- Ordinal regression models in psychological research: A tutorial, by Buerkner and Vuorre Answers a FAQ about linear mixed models.
-
Bayesian workflow tutorial, by Schad, Betancourt, Vasishth Applies Betancourt's ideas to psycholinguistics.
-
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.
-
A Student's Guide to Bayesian Statistics, by Ben Lambert: A good, non-technical introduction to Stan and Bayesian modeling.
- Statistical Rethinking, by Richard McElreath: A classic introduction.
- 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
-
Example random-effects meta-analysis.
-
Example of finite mixture models using Stan.
- Replication attempt of a published study.
- Bayesian analysis of relatively large-sample psycholinguistic experiment.
There are many more articles that use Bayesian methods, see my home page (under publications).