I love Richard McElreath’s Statistical Rethinking. It’s the introductory textbook to Bayesian statistics I looked a couple years, for. However, I’ve come to prefer using Paul Bürkner’s brms package when doing Bayesian regression in R. So, this project is an attempt to re-express the code in McElreath’s textbook. All the models are re-fit in brms. In addition, I also show how to wrangle the data in the tidyverse style and make the plots with ggplot2.
Andrew Hayes’s Introduction to Mediation, Moderation, and Conditional Process Analysis, the second edition of which just came out, has become a staple in social science graduate education. Both editions of his text have been from a frequentist OLS perspective. This project is an effort to connect his work with the Bayesian paradigm. Herein I refit his models with my favorite R package for Bayesian regression, Bürkner’s brms and use the packages from the tidyverse to visualization and data manipulation.
As Kruschke began his text, “this book explains how to actually do Bayesian data analysis, by real people (like you), for realistic data (like yours).” In the same way, this project is designed to help those real people do Bayesian data analysis. My contribution is converting Kruschke’s JAGS code for use in Bürkner’s brms package, which makes it easier to fit Bayesian regression models in R using Hamiltonian Monte Carlo (HMC). I also prefer plotting and data wrangling with the packages from the tidyverse and use those methods throughout. Unlike the other two books, this project is still in the working phase.