[R] aov() and lme()

Spencer Graves spencer.graves at pdf.com
Sun Nov 6 01:04:17 CET 2005


	  Have you solved this problem yet?  If no, and if you would still like 
a solution, I suggest you try to develop a much simpler example that 
still produces results like this that you don't understand.  Either use 
data that are already in a standard R library or are a Monte Carlo that 
a reader can generate with a very few lines of code and can run and get 
the same answers as you get (using set.seed).  The send that to r-help 
(after reading the posting guide 
"www.R-project.org/posting-guide.html").  Doing that should increase the 
chances that you can solve the problem yourself and, failing that, will 
get quicker and more useful replies from this list.

	  Viel Glueck
	  spencer graves

Jan Wiener wrote:

> Sorry for reposting, but even after extensive search I still did not 
> find any answers.
> 
> using: 
> summary(aov(pointErrorAbs~noOfSegments*turnAngle+Error(subj/(noOfSegments+turnAngle)), 
> data=anovaAllData ))
> 
> with subj being a random factor and noOfSegments and turnAngle being 
> fixed factors, I get the following results:
> 
> ----------------------------------------------
> Error: subj
>            Df Sum Sq Mean Sq F value Pr(>F)
> Residuals 17 246606   14506
> 
> Error: subj:noOfSegments
>               Df  Sum Sq Mean Sq F value   Pr(>F)
> noOfSegments  3  7806.6  2602.2  5.3257 0.002864 **
> Residuals    51 24919.4   488.6
> ---
> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
> 
> Error: subj:turnAngle
>            Df Sum Sq Mean Sq F value  Pr(>F)
> turnAngle  5  14660    2932  3.1707 0.01131 *
> Residuals 85  78600     925
> ---
> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
> 
> Error: Within
>                          Df Sum Sq Mean Sq F value    Pr(>F)
> noOfSegments:turnAngle  15  19637    1309  2.9135 0.0001711 ***
> Residuals              687 308687     449
> ---
> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
> ------------------------------------------------------------------
> 
> all is fine, and I get  exactly the same results as with unix anova.
> 
> 
> No I trying to fit the same data with lme and using the following call:
> 
> anova(lme(fixed=pointErrorAbs~noOfSegments*turnAngle, random=~1|subj, 
> data=anovaAllData))
> 
> Unfortunately the results are 'really' different from the aov() 
> procedure (I guess I have the call wrong):
> 
> ----------------------------------------------------
> (Intercept)                1   823 42.10888  <.0001
> noOfSegments               3   823  5.19549  0.0015
> turnAngle                  5   823  5.85379  <.0001
> noOfSegments:turnAngle    15   823  2.61373  0.0007
> ----------------------------------------------------
> 
> I, however, need a comparable method for lme(), because in a different 
> data set I have single empty cells and can therefore not use aov().
> 
> does anyone know how to fit with lme() to obtain the same results (for 
> this balanced data set) as with aov().
> 
> Thanks in advance,
> Jan
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

-- 
Spencer Graves, PhD
Senior Development Engineer
PDF Solutions, Inc.
333 West San Carlos Street Suite 700
San Jose, CA 95110, USA

spencer.graves at pdf.com
www.pdf.com <http://www.pdf.com>
Tel:  408-938-4420
Fax: 408-280-7915




More information about the R-help mailing list