Skip to content
Prev 2789 / 20628 Next

Specifying Crossed vs. Nested Factors with Lmer and bootstrapping downstream statistics

On Wed, Sep 9, 2009 at 9:58 AM, Andrew Dolman <andydolman at gmail.com> wrote:
Actually it would be

lmer(SVL ~ Treatment + (1|Family) + (1|Treatment:Box1), dataset)

so that you don't try to model Treatment as both a fixed effect and a
random effect.  A term like (1|Treatment/Box1) expands to
(1|Treatment) + (1|Treatment:Box1)

In fact, if the levels of Box1 are defined so that they are distinct
both within and between treatments you can write the model as

lmer(SVL ~ Treatment + (1|Family) + (1|Box1), dataset)

The nesting of Box1 within Treatment can be discovered from the data
as long as the levels of Box1 are defined as described above.