Generalized mixed models for poisson distributions
Thanks! To clarify the simple mistake I was making for possible future novice readers of this mailing list: I did not understand that the glm function cannot handle random effects (which Faraway NEVER mentions in his book). I also did not understand that glmer and lmer can both handle non-linear data as long as the "family" is specified. I am very comfortable with linear models, linear mixed effect models, and non-linear models, but I have been having a lot of trouble tackling non-linear mixed effect models. I really do wish we could all agree on terms for these models (GLM is used for both general linear mixed models and generalized mixed models in many fields). Anyway, these were very rudimentary stumbling blocks that were not immediately apparent to me, so hopefully this will clarify for others. Thanks again, -Page
Ben Bolker wrote:
glm doesn't do mixed effects models at all. You might (?) be confused about this because some software packages (SAS in particular, I don't know about SPSS) use the acronym GLM to refer to "general linear models" (rather than general*ized* linear models). Some particular kinds of linear mixed models (nested, balanced designs) can be estimated using the same general approaches used for ANOVA (in R, this would correspond to using aov with an Error term in the model). Linear models: lm (or aov) Generalized linear models: glm For linear mixed models you need lme (in the nlme package) or lmer (lme4). For generalized linear mixed models you need glmmPQL (MASS/nlme) or glmer (lme4). Ben Bolker
************************************ Page E. Van Meter Michigan State University Department of Zoology vanmete7 at msu.edu **http://msu.edu/~vanmete7/*