Skip to content
Prev 13861 / 20628 Next

Model is nearly unidentifiable with lmer

lme4 always treats grouping variables (those on the right side of a
bar in a random-effects term such as (1|g) ) as factors, no matter
what their underlying type is.  This is particularly useful for models
such as  z ~ year + (1|year), which treats year as numeric (i.e.
fitting a linear regression line) in the fixed-effects part of the
model but as a categorical grouping variable (i.e. fitting year-level
deviations from the regression line) in the random-effects part of the
model.

  That said, if you have variables that are numeric in appearance but
are always going to be treated as categorical (e.g. subject IDs that
are arbitrary numeric codes), it's best practice to explicitly convert
them to factors early in your workflow.
On Sun, Oct 18, 2015 at 11:46 AM, Chunyun Ma <mcypsy at gmail.com> wrote: