Skip to contents

Usage

# S3 method for class 'merMod'
deviance(object, REML = NULL, ...)

Deviance and log-likelihood of GLMMs

One must be careful when defining the deviance of a GLM. For example, should the deviance be defined as minus twice the log-likelihood or does it involve subtracting the deviance for a saturated model? To distinguish these two possibilities we refer to absolute deviance (minus twice the log-likelihood) and relative deviance (relative to a saturated model, e.g. Section 2.3.1 in McCullagh and Nelder 1989).

With GLMMs however, there is an additional complication involving the distinction between the likelihood and the conditional likelihood. The latter is the likelihood obtained by conditioning on the estimates of the conditional modes of the spherical random effects coefficients, whereas the likelihood itself (i.e. the unconditional likelihood) involves integrating out these coefficients. The following table summarizes how to extract the various types of deviance for a glmerMod object:

conditionalunconditional
relativedeviance(object)NA in lme4
absoluteobject@resp$aic()-2*logLik(object)

This table requires two caveats:

  • If the link function involves a scale parameter (e.g. Gamma) then object@resp$aic() - 2 * getME(object, "devcomp")$dims["useSc"] is required for the absolute-conditional case.

  • If adaptive Gauss-Hermite quadrature is used, then logLik(object) is currently only proportional to the absolute-unconditional log-likelihood.

Note that summary() reports the unconditional absolute deviance, -2*logLik(object).

For more information about this topic see the misc/logLikGLMM directory in the package source.