Move beyond OLS!
An introduction to Poisson, Beta, and zero-inflated Beta Bayesian distributional regression models
Workshop presented at the Department of Agronomy at Kansas State University
Materials
All the materials we’ll use today are in this RStudio project. You can open this project in your browser without needing to install or download anything on your computer. Open this Posit.cloud project (you’ll need to create a free account really quick):
Alternatively, you can download all the files to your computer. It is a .zip
file, so make sure you extract/unzip it after downloading it (especially if you’re using Windows!)
Examples
Access the three different examples we’ll work through with the navbar at the top, or here:
Resources
Bayesian modeling
Bayes Rules! An Introduction to Applied Bayesian Modeling: This is the absolute best introductory textbook for Bayesian methods and multilevel models, and it’s free! I’ve created a notebook translating all its code to {brms} and raw Stan here.
The super canonical everyone-has-this-book book is Statistical Rethinking by Richard McElreath. At that page he also has an entire set of accompanying lectures on YouTube. He doesn’t use {brms}, but Solomon Kurz has translated all his models to tidyverse-based brms code here.
Visualizing the differences between Bayesian posterior predictions, linear predictions, and the expectation of posterior predictions: A guide to different types of Bayesian posterior distributions and the nuances of
posterior_predict()
,posterior_epred()
, andposterior_linpred()
Fancier regression
Poisson & Negative Bionomial Regression, chapter 12 in Bayes Rules!
A guide to modeling proportions with Bayesian beta and zero-inflated beta regression models: A guide to Beta, zero-inflated Beta, one-inflated Beta, and zero-one-inflated Beta regression
Working with tricky outcomes with lots of zeros: A notebook illustrating zero-inflated and hurdle models in practice
Marginal effects
{marginaleffects} documentation: Incredible book-style documentation showing how the {marginaleffects} package works
Marginalia: A guide to figuring out what the heck marginal effects, marginal slopes, average marginal effects, marginal effects at the mean, and all these other marginal things are: Big practical guide to calculating different types of marginal effects