# Predict random effects in a multilevel model with Empirical Bayes

In multilevel models, it is possible to predict (not estimate) the random effects by Empirical Bayes after the model parameters have been estimated.

I know how to use the ranef() command to do that. However, I am interested in understanding the procedure.

Can someone provide an explanation/example how I can derive the Empirical Bayes predictions for the random effects “manually” for the example below?

# Load R package
library(lme4)