[R] lmer: random factor nested in a fixed factor
Christian Ritz
ritz at life.ku.dk
Mon Oct 6 17:02:08 CEST 2008
Dear Agnes,
I think your model specification should look like this:
YourModel1 <- lmerlmer(y ~ poptype*matingtype + (1|poptype:pop) + (1|poptype:fam),
data = ...)
The "1" in front of "|" refers to models that are random intercepts models as opposed to
general random coefficients models in which case "1" would need to be replaced by a
variable that is quantitative. So, the "(poptype|/pop/fam)" construction is definitely not
relevant to your problem, unless "poptype" is a quantitative variable...
The combined factor "poptype:pop" corresponds to the factor pop, but taking the nesting
structure into account. Similar for the construction "poptype:fam".
>From the summary output of the lmer() fit you should be able to check whether or not the
correct number of groups are used for these random factors.
Kind regards
Christian
More information about the R-help
mailing list