When I run this code to plot standardized residuals for a standard logistic regression:
#### Standarized Residuals Fixed Model ####
model.data <- augment(normal.model) %>%
mutate(index = 1:n())
model.data %>% top_n(3,.cooksd)
ggplot(model.data,
aes(index,
.std.resid)) +
geom_point(aes(color = factor(Outcome)),
alpha = .5)
There is no issue and I can plot what I want. However, when I do the same thing for a random intercepts mixed model:
model.data.ri <- augment(random.model) %>%
mutate(index = 1:n())
I get this warning:
Warning messages:
1: In hatvalues.merMod(model) :
the hat matrix may not make sense for GLMMs
2: In hatvalues.merMod(model) :
the hat matrix may not make sense for GLMMs
Now of course I could just run this as is, but I was curious what the hat matrix was and why one would need to be careful with a GLMM interpretation of it?

