Hierarchical and Mixed Effects Models in R
Richard Erickson
Data Scientist
$ y \sim \beta_i x + \epsilon$
$ \beta_i \sim ~ \text{Normal}( \mu, \sigma)$
library(lme4)
lmer(y ~ x + (1 | random_group), data = my_data)
lmer(y ~ x + (random_slope | random_goup), data = my_data)
Hierarchical and Mixed Effects Models in R