Skip to content

Help with three-way anova

2 messages · michael watson (IAH-C), Federico Calboli

#
OK, so I tried using lm() instead of aov() and they give similar
results:

My.aov <-  aov(IL.4 ~ Infected + Vaccinated + Lesions, data)
My.lm  <-   lm(IL.4 ~ Infected + Vaccinated + Lesions, data)

If I do summary(My.lm) and summary(My.aov), I get similar results, but
not identical.
If I do anova(My.aov) and anova(My.lm) I get identical results.  I guess
that's to be expected though.

Regarding the results of summary(My.lm), basically Intercept, Infected
and Vaccinated are all significant at p<=0.05.  I presume the
signifcance of the Intercept is that it is significantly different to
zero?  How do I interpret that?

Many thanks
Mick

-----Original Message-----
From: Federico Calboli [mailto:f.calboli at imperial.ac.uk] 
Sent: 05 April 2005 16:33
To: michael watson (IAH-C)
Cc: r-help
Subject: Re: [R] Help with three-way anova
On Tue, 2005-04-05 at 15:51 +0100, michael watson (IAH-C) wrote:

            
I'd say no. Use lm() instead, save your analysis in an object and then
possibly use drop1() to check the analysis
The use of aov() per se seems fine, but you did not put any interaction
in the model... for that use factor * factor.

HTH,

F
#
On Wed, 2005-04-06 at 09:11 +0100, michael watson (IAH-C) wrote:
Incidentally, if you want interaction terms you need 

lm(IL.4 ~ Infected * Vaccinated * Lesions, data)

for all the possible interactions in the model (BUT you need enough
degrees of freedom from the start to be able to do this).
I guess it's all due to the contrast matrix you used. Check with
contrasts() the term(s) in the datafile you use as independent
variables, and change the contrast matrix as you see fit.

HTH,

F