Skip to content

residuals from glmm using lmer

3 messages · martin highfield, Ben Bolker

#
martin highfield <mhighfield106 at ...> writes:
You can convince yourself that they're the Pearson residuals
(which are NOT what you've quoted here -- you've quoted the Pearson
residuals for the Poisson case [and I think you're missing parentheses?])

head(res)
head(y-fit)  ## not the same as res
est.sd <- sqrt(fit*(1-fit))
head((y-fit)/est.sd)   ## the same as res
fitted() gives you the unconditional (fixed+random) estimates.
  
  Don't have time to work it out now, but you can construct your
own fixed- and random-effect predictions by constructing the appropriate
model matrices and multiplying by the random effects (ranef())
and fixed effect parameter (fixef()) vectors ...

  By the way, since you didn't add any group-level variation
to your example above, all the random effects are zero ...
1 day later