[R-sig-ME] Using lmer on an augmented alpha square model
ONKELINX, Thierry
Thierry.ONKELINX at inbo.be
Wed Sep 10 10:55:03 CEST 2014
Dear Ginnie,
I presume that each GinnieEntry has only one trial? Otherwise it is impossible to have ranef(lmm2)$'GinnieEntry:Trial' == ranef(lmm3)$'GinnieEntry' If you have only one trial per GinnieEntry then (1|GinnieEntry) and (1|GinnieEntry:Trial) represent exactly the same information.
(1|Entry/GinnieEntry) is the notation for GinnieEntry nested in Entry. You can write this as (1|Entry) + (1|Entry:GinnieEntry). In case that the levels of GinnieEntry are unique (= used in only one Entry) then you have implicit nesting and (1|Entry) + (1|GinnieEntry) has the same interpretation as (1|Entry/GinnieEntry)
We will need a reproducible example to figure out why all models yield the same random effects.
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525 02 51
+ 32 54 43 61 85
Thierry.Onkelinx op inbo.be
www.inbo.be
To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of.
~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data.
~ Roger Brinner
The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey
-----Oorspronkelijk bericht-----
Van: r-sig-mixed-models-bounces op r-project.org [mailto:r-sig-mixed-models-bounces op r-project.org] Namens Morrison, Ginnie D.
Verzonden: dinsdag 9 september 2014 20:57
Aan: r-sig-mixed-models op r-project.org
Onderwerp: [R-sig-ME] Using lmer on an augmented alpha square model
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]]
_______________________________________________
R-sig-mixed-models op r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
* * * * * * * * * * * * * D I S C L A I M E R * * * * * * * * * * * * *
Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is door een geldig ondertekend document.
The views expressed in this message and any annex are purely those of the writer and may not be regarded as stating an official position of INBO, as long as the message is not confirmed by a duly signed document.
More information about the R-sig-mixed-models
mailing list