[R] denDF in lme with random factor

Gijs Plomp gplomp at brain.riken.jp
Wed Jun 2 07:16:22 CEST 2004


Dear All,

I would like to do a repeated measures analyis of a 4x6x2 factorial 
design with subject as a random variable.

According to the lme documetation, this is the way to do it:
 > anova(exp2.lme<-lme(RTs~rot*fu*fig, random = ~1|sub, data=exp2))

Yet, this gives a table in which all denDFs are identical. This does not 
seem right.

When I specify the test as
 > anova(exp2.lme<-lme(RTs~rot*fu*fig, random = ~1|sub/rot, data=exp2))
I get the right denDF value for the factor 'rot' only, theoutput looks 
like this:

 numDF denDF   F-value p-value
(Intercept)     1  8582 224052069  <.0001
rot             3    45         3  0.0356
fu              5  8582        81  <.0001
fig             1  8582       630  <.0001
rot:fu         15  8582         0  0.9565
rot:fig         3  8582         1  0.3089
fu:fig          5  8582        32  <.0001
rot:fu:fig     15  8582         1  0.8884


Is there a way to specify that subjects are a random factor over all 
variables?
i.e. the lme equivalent of  
exp2.aov<-aov(RTs~fig*rot*fu+Error(sub/(fig+rot+fu)), data=exp2)

I am new to R and hope this question is not too much of a 'newby' one...

Sincerely,

Gijs Plomp




More information about the R-help mailing list