[R-sig-ME] Using lmer on an augmented alpha square model

Morrison, Ginnie D. morrisong at missouri.edu
Tue Sep 9 20:56:51 CEST 2014


Hello,
This question is actually several questions rolled into one. I'm starting to analyze data from an experiment setup as an augmented design. There are a number of effects to keep track of and a good deal of nesting. To give a snapshot of the data:

     >head(data)
     Relative_Date Gen Check3 Environment GinnieEntry Trial Entry Block_uni
    1            68  S0      0           1        1362     1   681     5:1:1
    2            70  S1      0           1        1361     1   681     5:1:1
    3            72  S0      0           1        1360     1   680     5:1:1
    4            72  S1      0           1        1359     1   680     5:1:1
    5            71  S0      0           1        1282     1   641     5:1:1
    6            72  S1      0           1        1281     1   641     5:1:1

    >str(data)
    'data.frame':    5040 obs. of  8 variables:
 $ Relative_Date: num  68 70 72 72 71 72 68 69 67 71 ...
 $ Gen          : Factor w/ 2 levels "S0","S1": 1 2 1 2 1 2 1 2 1 2 ...
 $ Check3       : Factor w/ 3 levels "0","2000","2001": 1 1 1 1 1 1 1 1 1 1 ...
 $ Environment  : Factor w/ 3 levels "1","2","3": 1 1 1 1 1 1 1 1 1 1 ...
 $ GinnieEntry  : Factor w/ 1850 levels "1","2","3","4",..: 1362 1361 1360 1359 1282 1281 1538 1537 1264 1263 ...
 $ Trial        : Factor w/ 2 levels "1","0": 1 1 1 1 1 1 1 1 1 1 ...
 $ Entry        : int  681 681 680 680 641 641 769 769 632 632 ...
 $ Block_uni    : Factor w/ 210 levels "1:1:2","1:1:3",..: 127 127 127 127 127 127 127 127 127 127 ...

Checks are either: you're not a check, or you're Check 1 or 2. Each Entry has two GinnieEntries, one of which is Gen S0, the other S1. Trial indicates if you are in the trial (not a check), or not. GinnieEntries should be kept paired as they are related, which is part of what we're interested in.

To the best of my understanding, an appropriate model, if were ignoring Entry for now, would be:

   >lmm1<-lmer(Relative_Date~Gen+Check3+(1|Environment)+(1|GinnieEntry:Trial)+(1|Block_uni),data=data)

However, there is the issue of the GinnieEntry being nested within Entry, which, if I understand correctly, you cannot explicitly model with lme4. I understand that this is due to how lmer does the random effects analysis. So to see what happens when I add in the Entry:Trial term, I ran 3 more models:
    >lmm2<-lmer(Relative_Date~Gen+Check3+(1|Environment)+(1|GinnieEntry:Trial)+(1|Entry)+(1|Block_uni),data=data)

    >lmm3<-lmer(Relative_Date~Gen+Check3+(1|Environment)+(1|GinnieEntry)+(1|Entry:Trial)+(1|Block_uni),data=data)

    >lmm4<-lmer(Relative_Date~Gen+Check3+(1|Environment)+(1|GinnieEntry)+(1|Entry)+(1|Block_uni),data=data)

The scary thing is that all the random effects (and fixed effects) remain the same between all models. Which is to say,
ranef(lmm1)$'GinnieEntry:Trial' == ranef(lmm2)$'GinnieEntry:Trial' == ranef(lmm3)$'GinnieEntry' == ranef(lmm4)$'GinnieEntry'
(which goes for Environment, Entry in the same way, and Block_uni). Is this an artifact of my data? Do I not understand the whole Trial:Entry type of interaction? Is there something up with the way nesting works? Or have I formatted the data (I assume Check3 or Trial) in such a way that I am not doing what I think I am? Any insight into this would be great--this is the first time I'm working with an augmented experiment, and most of the programming documentation I can find uses SAS for such an analysis. I can provide more info as needed.
Thank you,
Ginnie Morrison
Post-doctoral Fellow
University of Missouri, Columbia

	[[alternative HTML version deleted]]



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