[R] nested random factor using lme produces errors

Ben Bolker bbolker at gmail.com
Mon Feb 18 17:23:53 CET 2013


melswed <amelie.truchy <at> slu.se> writes:

> 
> I understand. I want to specify that drug is only a fixed factor and family
> should be the only random factor. So maybe, my R code is wrong.... If I
> specify random=~1|drug/family it is only because I wanted to specify that
> family is nested within drug.


 Then you want 

random=~1|drug:family

drug/family expands to drug + drug:family, so it includes both an effect of
drug and a family-within-drug term.

See http://glmm.wikidot.com/faq#modelspec , which I've just updated.



More information about the R-help mailing list