[R-sig-ME] Question: incorporating paired data into mixed models

Ben Bolker bbolker at gmail.com
Tue Jul 17 15:44:30 CEST 2012

Julie Kern <juliekern27 at ...> writes:

> Apologies in advance if this is very simple, I’m new to R.  I’m
> analysing playback data which is paired but also contains repeated
> measures. Playbacks involved 2 calls, one the experimental treatment
> (alarm call), one the control treatment (contact call), both of the
> same individual. Each of 4 groups received 6 playback pairs of the
> alarm & contact call but none of the callers were used more than once
> (i.e. 1 pair). Here’s a data sample:

> Model<-lme (Latency~Treatment, random=~1|Group, data=mydata, method="ML")
> Does it work if I add pair as a random factor?

Yes, you should add pair (which seems to be Caller.ID in your
data set), as a random factor.  I think you can do this with
a nesting statement as follows, even though the pairs are uniquely

Model<-lme (Latency~Treatment, random=~1|Group/Caller.ID, 
     data=mydata, method="ML")

More information about the R-sig-mixed-models mailing list