[R] Question about aov

Alexander Keedy
Sun, 07 Oct 2007 18:36:50 -0000

Hello R gurus,

  I am a beginner with R.  I am doing an ANCOVA analysis using 'aov,'
and need some help understanding how 'aov' works.  I have a dataset
(taken from http://faculty.vassar.edu/lowry/ch17pt2.html) looking at hypnotic
induction.  The variable 'X' is a measure of how susceptible the subject
is to being hypnotized, the variable 'Y' is how well the subject was
hypnotized in the experiment, and the variable 'Method' is the method of
hypnosis used in the experiment.

  If I use the following code, I get the correct analysis (F = 16):

  ANCOVA=aov(lm(Y~X+Method,data=hypnotic.induction))
summary(ANCOVA);

  But if I switch the order of independent variables to:

  ANCOVA=aov(lm(Y~Method+X,data=hypnotic.induction))
summary(ANCOVA)

  I get a very different result (F = 0.8).

  I assume it has something to do with the order in which the variables are
entered into the regression? In 'aov' is there something
'special' about the first independent variable entered into the formula?
It would be greatly appreciated if anyone could shed some light on these
results?

  Thanks!

  Alex Keedy


---------------------------------

	[[alternative HTML version deleted]]