Skip to content
Prev 20255 / 20628 Next

glmer conditional deviance DECREASING after removal of fixed effect??

I may have attributed the confusion about conditional and marginal
deviances to you, Juho, when in fact it is the fault of the authors of
lme4, of whom I am one.  If so, I apologize.

We (the authors of lme4) had a discussion about the definition of deviance
many years ago and I am not sure what the upshot was.  It may have been
that we went with this incorrect definition of the "conditional deviance".
Unfortunately my R skills are sufficiently atrophied that I haven't been
able to look up what is actually evaluated.

The area of generalized linear models and generalized linear mixed models
holds many traps for the unwary in terms of definitions, and some casual
definitions in the original glm function, going as far back as the S3
language, aid in the confusion.  For example, the dev.resid function in a
GLM family doesn't return the deviance residuals - it returns the square of
the deviance residuals, which should be named the "unit deviances".

Given a response vector and the predicted mean vector and a distribution
family one can define the unit deviances, which play a role similar to the
squared residual in the Gaussian family.  The sum of these unit deviances
is the deviance of a generalized linear model, but it is not the deviance
of a generalized linear mixed model, because the likelihood for a GLMM
involves both a "fidelity to the data" term *and* a "complexity of the
model" term, which is the size of the random effects vector in a certain
metric.

So if indeed we used an inappropriate definition of deviance the mistake is
ours and we should correct it.
On Thu, Aug 31, 2023 at 7:56?AM Douglas Bates <dmbates at gmail.com> wrote: