# NOT RUN {
data(sleepstudy, package = 'lme4')
fm <- lme4::lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
# Observation level leverage
lev1 <- leverage(fm, level = 1)
head(lev1)
# Group level leverage
lev2 <- leverage(fm, level = "Subject")
head(lev2)
# }
Run the code above in your browser using DataLab