[R] lme: error message with random=~1

Thomas Petzoldt thpe at hhbio.wasser.tu-dresden.de
Wed Jan 5 11:11:41 CET 2005


Hello,

I have an unbalanced mixed model design with two fixed effects
"site" (2 levels) and "timeOfDay" (4 levels) and two random effects
"day" (3 consecutive days) and "trap" (6 unique traps, 3 per site).

The dependent variable is the body length ("BL") of insect larvae from 7 
to 29 individuals per trap (104 individuals in total).

To account for pseudo replication I used nlme (or lme4 as suggested for 
crossed random factors). The results indicate, that the random effects 
are very small, so I followed the lme example and tried to fit a model 
with random=~1.

Unfortunately I got the following error message:

Error in getGroups.data.frame(dataMix, groups) :
	Invalid formula for groups

I suppose, that it would be redundant (and confusing to the reader) if 
we leave unnecessary random effects in the model, but due to pseudo 
replication it may be an offense if we simply ignore it and use lm.

Reading the respective chapters in Pinheiro & Bates, Venables & Ripley 
and Crawley several times, I found no example for this situation. Is 
there a common way how to handle this?

Thomas P.

PS: I can provide a full example, if necessary.




More information about the R-help mailing list