Professional Documents
Culture Documents
1 Way Analysis of Variance (ANOVA) : Peter Shaw RU
1 Way Analysis of Variance (ANOVA) : Peter Shaw RU
Variance (ANOVA)
Peter Shaw
RU
Do males differ
from females?
Do results differ
between these
sites?
Nonparametric
2 classes
only
t test, anova
MannWhitney U
2 or more
classes
anova
KruskalWallis test
Residuals
Overall
mean
()
1 2
8 Datapoint number
New residuals
Mean of treatment 2
1 2 3 4
Treatment 1
5 6 7 8 Datapoint number
Treatment 2
Linear model: Each observation is the mean plus a treatment effect plus
random error: Xti = +Tt+ eti
Total sum of squares = i (Xi- ) 2 = ti (eti * eti) + ti (Tti * Tti)
= error sum of squares + treatment sum of squares
(This is how variation is partitioned. Notice that it only works if ti (eti)
= (T ) = 0)
Now we have one sum of squares which has been partitioned into two
sources, explained and unexplained.
The null hypothesis H0 says that these two sources of variation should
be equally unimportant, both unexplained random noise. In order to
test this we cannot simply look at the sums of squares (because the
more samples you collect the more variation you may find), but first
divide these by their degrees of freedom to convert SS into variance:
Total variance = total SS / total df true but not used in most anova tables
Anova tables:
MS
F
=SStrt/(T-1) MStrt/MSerr
=SSerr/dferr
T2
14
16
19
18
15
T3
20
18
22
19
16
Post-hoc tests
Often one runs an ANOVA on a dataset where the treatment
variable comes at >3 levels. If p>0.05 you simply assume that the
groups do not differ. If however p<0.05, students often ask whether
this proves some specific difference, such as showing that site 1
differs from site 2.
p1
p2
p3
1 time in 20 p1-p2 is *
1 time in 20 p1-p3 is *
1 time in 20 p2-p3 is *
Now we ask what the probability is that we will end up accepting H0.
This involves accepting H0 in test 1 (P1P2), AND in P1-P3, AND in
P2P3. In each case the probability of accepting H0 is 0.95 (=1-p), but
the probability of accepting the 3 together is 0.95*0.95*0.95 = 0.857375
(nearly, but not quite, 1-3*p).
(1- )
Post-hoc
tests
in
SPSS
Are hidden under Compare means 1 way anova.
100
80
60
40
Fe,
FEppm
20
25
-20
N=
site 1
site 2
site 3
site 4
site 5
site 6
site 7
SITE
Duncans
multiple
range
test:
Note
1: Means are sorted into ascending order
2: all bar 2 are in a homogenous subgroup: site 3 is in a group by itself,
FE
as is site 2.
Duncan
NUMSITE
1.00
7.00
6.00
5.00
4.00
3.00
2.00
Sig.
N
8
8
8
8
8
8
8
Presentation methods:
1: Leave means sorted into order and underline
those that do not differ
120
100
80
60
40
20
FE
25
-20
N=
1
7
2.00
Site
SIZEORDR
1.00
3.00
4.00
5.00
6.00
7.00
Leave the means in their original order but indicate which group they
in by giving a letter of the alphabet to each line in the graph just
presented. Then you add the text means followed by the same letter d
not differ at p<0.05.
1.00
2.00
3.00
4.00
5.00
6.00
7.00
1.00
62.50
19.00
2.38
1.38
1.25
1.13
A
C
B
A
A
A
A
40
48
30
20
MAYFLY
10
-10
N=
18
15
12
10
1.00
2.00
3.00
4.00
SITE
Site
1
12
3
4
2
NS
-
3
NS
4
NS
0.036
-
0.006
NS
-
40
48
30
20
MAYFLY
10
-10
N=
15
18
12
1.00
2.00
3.00
SIZEORDR
Site
Or list as follows:
Site 1AB 2A 3AB 4B
10
4.00
B
A