Skip to content

lmer model for repeated measure in RCB design

2 messages · Ben Bolker, Schreiber, Stefan

#
[cc'ing back to r-sig-mixed-models]
On 12-01-11 03:47 PM, Schreiber, Stefan wrote:
Technically, I would say that ID is not technically unique for each
observation since there are three observations (fall, winter, and
spring) for each ID ... ?  (You confirm this below: "each ID is
replicated three times ...") (By "observation", I mean the smallest
sampling unit -- one row of the data frame, in long format)
Makes sense.
That makes perfect sense.
This looks reasonable, although since id is *implicitly* nested (i.e.
it contains the genotype info) you should also be able to write it as
(1|genotype) + (1|id) .

   When you run this, lmer should report appropriate numbers of levels
in each group (block=5, genotype=8, genotype:id = 56? or 40? I'm not
sure ...) ... check these values and see that they are as you expect.
#
Hi all,

I have the following mixed model for my data (Thanks Ben!):

lmer.fit<- response ~ group*climate + (1|block) + (1|genotype) + (1|id)

Here's the summary:

Linear mixed model fit by REML 
Formula: response ~ group*climate + (1|block) + (1|genotype) + (1|id) 
   Data: plc 
  AIC  BIC logLik deviance REMLdev
 1275 1325   -622     1296    1243
Random effects:
 Groups   Name        Variance Std.Dev.
 id       (Intercept)  10.25    3.20   
 clone    (Intercept)   2.75    1.66   
 rep      (Intercept)   5.34    2.31   
 Residual             148.21   12.17   
Number of obs: 168, groups: id, 56; genotype, 7; block, 5

Then I ran TukeyHSD(aov(lmer.fit)) and it gives me no error and an
output that "looks" ok. However, I am uncertain whether this is correct
to do, or not.

Here is an made up example:
d.fr<-data.frame(id=rep(1:16,3),treat1=rep(as.factor(LETTERS[1:3]),each=
16),treat2=rep(as.factor(letters[4:7]),each=4),response=rnorm(48))
fit1<-lmer(response~treat1*treat2+(1|id),data=d.fr)
TukeyHSD(aov(fit1))

I hope to get some advice on whether this is a valid thing to do.

Thanks!
Stefan