[R] aov problem

Marc Schwartz marc_schwartz at comcast.net
Tue May 15 15:33:57 CEST 2007

On Tue, 2007-05-15 at 15:07 +0200, Anders Malmendal wrote:
> I am using R to make two-way ANOVA on a number of variables using
> g <- aov(var ~ fact1*fact2)
> where var is a matrix containing the variables.
> However the outcome seem to be dependent on the order of fact1 and fact2 
> (i.e. fact2*fact1) gives a slightly (factor of 1.5) different result.
> Any ideas why this is?
> Thanks for any help
> Anders

This is presumably an unbalanced design and R reports the sequential sum
of squares (aka Type I) based upon the order in which the factors enter
the model.


  RSiteSearch("aov order")

will lead you to many posts on the matter.

If you require other 'types' of SS, see the Anova() function in the
'car' package on CRAN by John Fox.

You also might want to see Prof. Venables' "Exegeses" paper:



Marc Schwartz

More information about the R-help mailing list