Skip to content
Prev 1315 / 20628 Next

Variance explained by random factor

On Thu, Aug 14, 2008 at 4:43 AM, Douglas Bates <bates at stat.wisc.edu> wrote:
But isn't possible that the log-likelihoods are incompatible between
glm and glmer?  Maybe one chose to drop an irrelevant constant and the
other didn't.

lmer currently doesn't let you specify a model without a random
effect, but I think this gets pretty close:

counts <- c(18,17,15,20,10,20,25,13,12)
outcome <- gl(3,1,9)
fixed <- rep(1, 9)
d.AD <- data.frame(treatment, outcome, counts)

m_glm <- glm(counts ~ outcome, family = poisson)
m_lmer <- glmer(counts ~ outcome + (1 | fixed), family = poisson)
'log Lik.' -23.38066 (df=3)
'log Lik.' -2.564571 (df=4)

Although they do have the same deviance:
ML
5.129141
[1] 5.129141


Hadley