Skip to content
Prev 13756 / 20628 Next

interaction and nested notation in lmer

On Mon, Sep 21, 2015 at 6:24 PM, Mashitah Jusoh <mashitahj at gmail.com> wrote:
If you have samples from only 2 years, it's not going to be
particularly practical to fit
a model with year as random effect.  Setting that aside for the moment,
the distinction between (1|year/rep) and (1|year:rep) is that the
former expands to
(1|year) + (1|year:rep)  (i.e., effect of year and effect of rep
within year), while the latter
is just rep within year -- i.e. no main effect of year.

  However, nesting syntax doesn't really doesn't work well for fixed
effects (partly
due to the way R handles the formulae, and partly for conceptual reasons) -- in
your model, year:rep would give 4 fixed-effect parameters, as would
year+rep+year:rep
or year*rep (two ways of specifying crossed effects)

  I think I would recommend

Y  ~ 1 + year*rep + (1|genotype) + (1|genotype:year)

With unbalanced data, it may be hard to get a unique decomposition of
variance ...

 Ben Bolker