Coming to grips with multi-level modeling

For our second zoom session, we’re going to do a bit of a deep dive, hands-on take on multi-level modeling.

Preparation for in-class activity

In class, we will be doing a walk-through of how to reproduce the analysis in Gelman (2006) using several R-based modeling tools. Before class, please:

  1. Install or update to the latest version of RStudio. The tutorial code will be contained in a Quarto markdown document. Quarto is an updated version of the venerable RMarkdown, and the newest versions of RStudio include Quarto support by default.

Before or at the beginning of class:

  1. Set up your R/RStudio installation to be able to load the following packages using the following code:
library(ggplot2)
library(tidyr)
library(dplyr)
library(bayesplot)
library(rstanarm)
library(purrr)
library(tidybayes)

If you are not sure if you have these installed or want to update to the latest versions, please paste this command into a running R session to download and install:

install.packages(c("ggplot2","tidyr","dplyr","bayesplot","rstanarm","purrr","tidybayes"))

If you run into problems with any of these, please let me know!

During Class

  • Slide

  • You can find the tutorial we are going to work through here

Additional Resources

References

Gelman, Andrew. 2006. “Multilevel (Hierarchical) Modeling: What It Can and Cannot Do.” Technometrics 48 (3): 432–35. https://doi.org/10.1198/004017005000000661.