Skip to content
Prev 170030 / 398506 Next

how to perform 5 level nested anova

Mao Jianfeng <jianfeng.mao <at> gmail.com> writes:
are 9447
First, note that one of the data was missing in line 51xx, this could have 
cause you some problem.

You probably forgot to convert the integer variables to factors,
these must be marked as categorical variables.
Your model works now, but I doubt you really wanted a random-only
model. One of my guesses, assuming SpecN is the fixed variable,
is shown below. 

Also check if package nlme; it should be possible to handle the
model with that package, which is much better documented
(Book by Pinheiro/Bates).

Dieter



seedL = read.table("seed.txt",header=TRUE)
# Make factors
for (i in 1:5) seedL[,i] = as.factor(seedL[,1])

library(lme4)
# works now, but I doubt you really want a random-only model
cmod<-lmer(SeedL~1+(1|SpecN)+(1|SpecN:PopN)+(1|SpecN:PopN:TreeN),
           data=seedL)
summary(cmod)
# My guess: this is closer to what you want, testing species
cmod1<-lmer(SeedL~SpecN+(1|SpecN:PopN)+(1|SpecN:PopN:TreeN),
           data=seedL)
summary(cmod1)