[R] aov, lme, multcomp

Richard D. Morey r.d.morey at rug.nl
Mon Aug 25 15:57:59 CEST 2008

I am doing an analysis and would like to use lme() and the multcomp 
package to do multiple comparisons. My design is a within subjects 
design with three crossed fixed factors (every participant sees every 
combination of three fixed factors A,B,C). Of course, I can use aov() to 
analyze this with an error term (leaving out the obvious bits):

y ~ A*B*C+Error(Subject/(A*B*C))

I'd also like to use lme(), and so I use

y ~ A*B*C, random= ~1|Subject

The tests give different Fs and ps. I know this comes up every once in a 
while on R-help so I did my homework. I see from these two threads:


that this is the expected behavior because of the way grouping works 
with lme(). My questions are:

1. is this the correct random argument to lmer:


2. How much do the multiple comparisons depend on the random statement?

3. I'm also playing with lmer:


Is this the correct lmer call for the crossed factors? If not, can you 
point me towards the right one?

4. I'm not too concerned with getting "correct" Fs from the analyses 
(well, except for aov, where it is easy), I just want to make sure that 
I am fitting the same model to the data with all approaches, so that 
when I look at parameter estimates I know they are meaningful. Are the 
multiple comparisons I'll get out of lme and lmer meaningful with fully 
crossed factors, given that they are both "tuned" for nested factors?

Thanks in advance.

Richard D. Morey
Assistant Professor
Psychometrics and Statistics
Rijksuniversiteit Groningen / University of Groningen

More information about the R-help mailing list