[R-sig-ME] [R] lme nesting/interaction advice

toby909 at gmail.com toby909 at gmail.com
Mon May 12 14:39:59 CEST 2008


this is not an easy and not a standard model.

if your 3-way anova is fully factorial, with one factor being random,
then you have a LOT of random effects. you have a random main effect,
you will have a number of random 2-way interction terms, and also a
random 3-way interaction effect, their covariance matrix most likely to
be nonpositive definite.

The nested model is actually the simpler one, and I have the hint that
the "basics" book does not present such a complicated model in its
introductory chapter.

also, you don't make it easy for people to help you. I could not easily
read in your data and I had to generate own data. :-(

Maybe you are looking for something similar to:

set.seed(78987)
a = rep(1:3,each=120)
b = rep(1:3,3, each=40)
c = rep(1:10,9,each=4)
y = rnorm(360,0,10)
x = cbind(a,b,c,y)
colnames(x) = c("a", "b", "c", "y")
x = as.data.frame(x)

lme = lme(y ~ factor(a)*factor(b)*factor(c)-1, x, ~factor(c))
anova(lme)

but again, I don't know if that is what you are looking for, and it may
not be correct.

T




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