Friday, February 17, 2012

lme4 nested example

http://lme4.r-forge.r-project.org/book/
chapter 2, we have example of nested factors

cask is nested in batch

so
strength ~ 1 + (1 | cask) + (1 | batch)
is problematic,

the correct one is
strength ~ 1 + (1 | cask) + (1 | batch:cask)
though
it is equivalent to
strength ~ 1 + (1 | batch / cask).

No comments: