[R] [PS] Two Way ANOVA
David Mackovjak
bejitto101 at yahoo.com
Thu Mar 20 00:54:47 CET 2008
I do have the values for each individual values for each cell. They are as follows:
N(0) N(20)
4.48 5.76
4.52 5.64
4.63 5.78
4.70 7.01
4.65 7.11
4.57 7.02
5.21 5.88
5.23 5.82
5.38 5.73
5.88 6.26
5.98 6.26
5.91 6.37
So how would I go about this then?
----- Original Message ----
From: Rolf Turner <r.turner at auckland.ac.nz>
To: David Mackovjak <bejitto101 at yahoo.com>
Sent: Wednesday, March 19, 2008 4:36:47 PM
Subject: Re: [R] [PS] Two Way ANOVA
With the given structure of your data you CANNOT test for interaction
in the
general sense. There are no degrees of freedom left for error.
If you have access to the (three) individual values in each cell,
then you
can test for interaction.
If these individual values are lost to posterity [Expostulation: Why
the
<expletive deleted> do people ***do*** things like this? Use your
<expletive deleted>
data, not summary statistics!!!] then you can still test for a
***particular form***
of interaction using Tukey's ``1 degree of freedom for non-
additivity' test.
I don't know if it's implemented in R, but it wouldn't be hard to
roll your own.
See ``Analysis of Messy Data'' volume 2 by George A. Milliken and
Dallas E. Johnson,
van Nostrand Reinhold, 1989, page 7 ff.
On 20/03/2008, at 12:03 PM, David Mackovjak wrote:
> Ben,
> I would like to test the sulfur on the clover field, nitrogen on
> the clover field and then test for the presence of interaction.
>
> Sorry about the last email, seems it really screwed itself over,
> here it is again, hopefully nicer:
>
> Nitrogen(0) Nitrogen(20)
> Sulfur(0) 4.54 5.73
> Sulfur(3) 4.64 7.05
> Sulfur(6) 5.27 5.81
> Sulfur(9) 5.81 6.30
>
> Each of those is a cell mean of 3 values.
>
> Would I simply do as follows?:
>
> yield<- c(4.54,4.64,5.27,5.81,5.73,7.05,5.81,6.30)
> sulfur <- c(1,2,3,4,1,2,3,4)
> nitro <- c(1,1,1,1,2,2,2,2)
Not quite; you need to make sulfur and nitro into ***factors***.
> summary(aov(yield~sulfur*nitro))
Better, I think, to use lm() directly rather than the aov() wrapper.
fit <- lm(yield ~ sulfur*nitro)
anova(fit)
You see that you get no F-tests. The model fits ``perfectly''
so there is no residual sum of squares (and no degrees of freedom for
error).
cheers,
Rolf Turner
######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:17}}
More information about the R-help
mailing list