Solved – How to analyze this incomplete block design in R

blockingexperiment-designlme4-nlmemixed model

I was just wondering if you could point me in the right direction.
I have a dataset with 5 tree clones planted at 10 different sites, i.e. same clones are replicated twice at different sites.

  Site Clone  
    1     A    
    2     A  
    3     B  
    4     B  
    5     C  
    6     C  
    7     D  
    8     D  
    9     E  
   10     E

At each site each clone is replicated multiple times. Ideally, I would want to know what is the effect of clone on my dependent variable y and whether a site effect is present. To me it looks like an incomplete block design with clone as a fixed effect and site as a random effect (and block). Using lmer from the lme4 package in R, I would specify the model as follows:

lmer(y~clone + (1|site), data=mydata)    

Is this a correct way of analyzing this dataset? I could also average by clone over sites and eliminate sites. But this way I will lose potential important information as to whether a site effect is present.

Any pointers are appreciated!

Best Answer

I think you're exactly right.

Set up data like your example:

d <- expand.grid(Site=factor(1:10),rep=1:5)
d <- transform(d,Clone=factor(LETTERS[(as.numeric(Site)+1) %/% 2]))
library(lme4)
## could use development version of lme4 to simulate, but will do
## it by hand
beta <- c(2,1,3,-2,2)  ## clone effects (intercept + differences)
X <- model.matrix(~Clone,d)
set.seed(1)
u.site <- rnorm(length(levels(d$Site)),sd=1)
    d$y <- rnorm(nrow(d),
       mean=X %*% beta + u.site[d$Site],
       sd=2)

Now analyze:

m1 <- lmer(y~Clone+(1|Site),data=d)
round(fixef(m1),3)
## (Intercept)      CloneB      CloneC      CloneD      CloneE 
##       2.624      -0.034       2.504      -2.297       2.396

VarCorr(m1)
##  Groups   Name        Std.Dev.
##  Site     (Intercept) 0.0000  
##  Residual             1.6108

I don't think there's actually anything wrong, but I used a pretty big residual variance, and so in this case (probably only on a subset of replicates), lmer estimates a zero among-site variation.

Related Question