[R] FW: Re: Doubt about nested aov output
Ken Knoblauch
knoblauch at lyon.inserm.fr
Thu Sep 8 15:23:28 CEST 2005
Your response nicely clarifies a question that I've had for a long time,
but which I've dealt
with by giving each subject a unique label. Unless I'm missing something,
both techniques should
work as the toy example below gives exactly the same output in all 3 cases
below (forgetting
about the convergence problem). Would there be a reason to prefer
labeling the levels
one way or another or is it just a matter of convenience?
library(lmer)
y <- rnorm(15)
cond <- gl(3, 5, 15)
obs <- gl(15, 1)
subj <- gl(5, 1, 15)
dd <- data.frame(y = y, cond = cond, obs = obs, subj = subj)
l1 <- lmer(y~cond + (1|cond:obs), dd)
l2 <- lmer(y~cond + (1|cond:subj), dd)
l3 <- lmer(y~cond + (1|obs), dd)
Douglas Bates a écrit:
The difference between models like
lmer(Glycogen~Treatment+(1|Rat)+(1|Rat:Liver))
and
lmer(Glycogen~Treatment+(1|Treatment:Rat)+(1|Treatment:Rat:Liver))
is more about the meaning of the levels of "Rat" than about the
meaning of "Treatment". As I understood it there are three different
rats labelled 1. There is a rat 1 on treatment 1 and a rat 1 on
treatment 2 and a rat 1 on treatment 3. Thus the levels of Rat do not
designate the "experimental unit", it is the levels of Treatment:Rat
that do this.
--
Ken Knoblauch
Inserm U371
Cerveau et Vision
Dept. of Cognitive Neuroscience
18 avenue du Doyen Lépine
69500 Bron
France
tel: +33 (0)4 72 91 34 77
fax: +33 (0)4 72 91 34 61
portable: +33 (0)6 84 10 64 10
http://www.lyon.inserm.fr/371/
More information about the R-help
mailing list