[R-sig-eco] lme4 for pseudoreplication avoidance

Lara R. Appleby 04 Lara.R.Appleby.04 at Alum.Dartmouth.ORG
Mon Feb 25 07:32:07 CET 2013


I am following a suggestion from http://www.coloss.org/beebook/I/invitro/3/1to  
use nesting in my analyses of measurements of individual worker ants within multiple  
colonies.

"y" is a worker-level trait (e.g. the size of an individual worker ant) measured  
once for each individual worker in the study
"a" is the colony ID
"b" is a colony-level trait (e.g. colony size at the beginning of the experiment)  
measured once for each colony in the study

All of the workers ("y") in a colony share an "a" value and a "b" value.

I want to know the independent effects of a and b on y, accounting for the non-independence  
of worker-level observations.

How do I code this kind of model?

I get as far as:

lme4 (y~a+b)

but I don't know how to code the nesting bit in this case.



More information about the R-sig-ecology mailing list