Beruflich Dokumente
Kultur Dokumente
Analysis of Variance
Normal
Nonnormal
Independent
Samples
(CRD)
Paired Data
(RBD)
F-Test
1-Way
ANOVA
F-Test
2-Way
ANOVA
KruskalWallis Test
Friedmans
Test
y i.
yij
j
ni
si
2
(
y
y
)
ij i.
j
ni 1
N n1 ... nt
n1 y1. ... nt y t .
y ..
yij
TSS i 1 j 1 ( yij y .. ) 2
k
ni
dfTotal N 1
ni
dfT t 1
ni
dfTotal dfT df E
df E N t
Sum of Squares
SST
SSE
TSS
Degrres of
Freedom
t-1
N-t
N-1
Mean Square
MST=SST/(t-1)
MSE=SSE/(N-t)
F
F=MST/MSE
MST
T .S . : Fobs
MSE
R.R. : Fobs F ,t 1, N t
P val : P ( F Fobs )
(Table 9)
E ( MST ) 2
2
n
i i
i 1
t 1
t
E ( MST )
E ( MSE )
2
n
i i
i 1
t 1
2
n
i i
i 1
2
(t 1)
E ( MST )
When H 0 : 1 t 0 is true,
1
E ( MSE )
E ( MST )
otherwise ( H a is true),
1
E ( MSE )
Fobs = MST/MSE
When H0 is true (1==t=0), E(MST)/E(MSE)=1
Marginal Effects of each factor (all other factors fixed)
As spread in (1,,t) E(MST)/E(MSE)
As (n1,,nt) E(MST)/E(MSE) (when H0 false)
As 2 E(MST)/E(MSE) (when H0 false)
0.09
0.09
0.08
0.08
0.07
0.07
0.06
0.06
0.05
0.05
0.04
0.04
E ( MST )
E ( MSE )
0.03
0.02
0.01
0
0
20
40
60
80
100
120
140
160
180
200
n
4
8
12
20
0.09
0.08
0.07
A
9
17
25
41
B
129
257
385
641
C
1.5
2
2.5
3.5
0.03
0.02
0.01
0
0
20
40
60
80
100
120
140
160
180
200
D
9
17
25
41
0.09
0.08
0.06
0.07
0.05
0.06
0.04
0.05
0.03
0.04
0.02
0.03
0.01
0.02
0.01
20
40
60
80
100
120
140
160
180
0
0
20
40
60
80
100
120
140
160
180
200
Y ' arcsin
100
Source: K.A. Engel and L.S. Young (1989). Spatial and Temporal Patterns in the Diet of Common
Ravens in Southwestern Idaho, The Condor, 91:372-378
Winter(i=1)
94.3
90.3
83.0
Fall(i=2)
80.7
90.5
91.8
Summer(i=3)
80.5
74.3
32.4
Fall (i=4)
67.8
91.8
89.3
Y'
j=1
j=2
j=3
Winter(i=1)
1.329721
1.254080
1.145808
Fall(i=2)
1.115957
1.257474
1.280374
Summer(i=3)
1.113428
1.039152
0.605545
Fall (i=4)
0.967390
1.280374
1.237554
1.400000
1.300000
Transformed % Vegetation
1.200000
1.100000
1.000000
0.900000
0.800000
0.700000
0.600000
0.500000
0
3
Season
SS
0.197387
0.241038
df
3
8
Total
0.438425
11
MS
F
P-value
0.065796 2.183752 0.167768
0.03013
F crit
4.06618
Season
1
1
1
2
2
2
3
3
3
4
4
4
Y'
1.329721
1.254080
1.145808
1.115957
1.257474
1.280374
1.113428
1.039152
0.605545
0.967390
1.280374
1.237554
Total SS
(Y-Overall Mean)2
TSS
0.037694
0.014044
0.000105
0.000385
0.014860
0.020968
0.000490
0.009297
0.280928
0.028285
0.020968
0.010400
0.438425
Between Season SS
(Group Mean-Overall Mean)2
SST
0.011584
0.011584
0.011584
0.006784
0.006784
0.006784
0.046741
0.046741
0.046741
0.000687
0.000687
0.000687
0.197387
SSE
0.007485
0.000118
0.009486
0.010400
0.001563
0.003899
0.037657
0.014346
0.098489
0.037785
0.014066
0.005743
0.241038
Within Season SS
(Y-Group Mean)2
Kruskal-Wallis Test
H0: The k population distributions are identical (1=...=k)
HA: Not all k distributions are identical (Not all i are equal)
2
12
k Ti
T .S . : H
3( N 1)
i 1
N ( N 1)
ni
R.R. : H
2
, k 1
P val : P ( H )
2
Season
1
1
1
2
2
2
3
3
3
4
4
4
Y'
1.329721
1.254080
1.145808
1.115957
1.257474
1.280374
1.113428
1.039152
0.605545
0.967390
1.280374
1.237554
H 0 : No seasonal difference
Rank
12
8
6
5
9
10.5
4
3
1
2
10.5
7
T1 = 12+8+6 = 26
T2 = 5+9+10.5 = 24.5
T3 = 4+3+1 = 8
T4 = 2+10.5+7 = 19.5
H a : Seasonal Differences
LSDij t / 2
1 1
MSE
n n
j
i
with df N t
Conclude i j if y i. y j . LSDij
Tukeys W Procedure
More conservative than Fishers LSD (minimum
significant difference and confidence interval width are
higher).
Derived so that the probability that at least one false
difference is detected is (experimentwise error rate)
Wij q (t , )
MSE
n
Conclude i j if y i. y j . Wij
t
1
1
n1
nt
Yij i j ij i j ij
t
i 1
0 E ( ij ) 0
V ( ij )
(1t )
(Not all i are equal)
y i.
y. j
y ..
TSS i 1 j 1 yij y ..
t
SSB t y
SSE y
df Total bt 1
SST b i 1 y i . y ..
df T t 1
df B b 1
j 1
.j
ij
..
y i. y . j y ..
df E (b 1)(t 1)
SS
SST
SSB
SSE
TSS
df
t-1
b-1
(b-1)(t-1)
bt-1
H0: 1t 0
HA: Not all i = 0
T .S . : Fobs
R.R. : Fobs
MS
MST = SST/(t-1)
MSB = SSB/(b-1)
MSE = SSE/[(b-1)(t-1)]
(1t )
(Not all i are equal)
MST
MSE
F ,t 1,( b 1)( t 1)
P val : P ( F Fobs )
F
F = MST/MSE
2 MSE
b
Conclude i j if y i. y j . Bij
MSERCB
(bt 1) MSE
Dose \ Subject
0
5
9
13
1
36.05
42.47
51.50
37.55
2
52.47
85.15
65.00
59.30
3
56.55
63.20
73.10
79.12
4
45.20
52.10
64.40
58.33
5
35.25
66.20
57.45
70.54
6
66.38
73.25
76.49
69.47
7
40.57
44.50
40.55
46.48
8
57.15
57.17
66.47
66.35
9
28.34
35.05
33.17
36.20
80.00
70.00
Time to Exhaustion
60.00
50.00
0 mg
5 mg
9mg
40.00
13 mg
30.00
20.00
10.00
0.00
0
5
Cyclist
10
0mg
36.05
52.47
56.55
45.20
35.25
66.38
40.57
57.15
28.34
46.44
-8.80
77.38
5mg
42.47
85.15
63.20
52.10
66.20
73.25
44.50
57.17
35.05
57.68
2.44
5.95
9mg
51.50
65.00
73.10
64.40
57.45
76.49
40.55
66.47
33.17
58.68
3.44
11.86
13mg
37.55
59.30
79.12
58.33
70.54
69.47
46.48
66.35
36.20
58.15
2.91
8.48
7752.773
df B 9 1 8
df
3
8
24
35
SS
933.12
5558.00
1261.65
7752.77
MS
311.04
694.75
52.57
5.92
MSE 52.57
R.R.( 0.05) : Fobs F.05,3, 24 3.01
P value : P ( F 5.92) .0036 (From EXCEL)
Conclude that true means are not all equal
F
5.92
1
3.90 W 3.90 52.57 9.43
9
Bonferroni' s B : t.05 / 2, 6, 24
Doses
5mg vs 0mg
9mg vs 0mg
13mg vs 0mg
9mg vs 5mg
13mg vs 5mg
13mg vs 9mg
2
2.875 B 2.875 52.57 9.83
9
High Mean
57.6767
58.6811
58.1489
58.6811
58.1489
58.1489
46.4400
12.2411
46.4400
11.7089
57.6767
1.0044
NSD
57.6767
0.4722
NSD
58.6811
-0.5322
NSD
3.79
(bt 1) MSE
(9(4) 1)(52.57)
1839.95
Would have needed 3.79 times as many cyclists per dose to have the
same precision on the estimates of mean endurance time.
9(3.79) 35 cyclists per dose
4(35) = 140 total cyclists
i 1 i
bk (k 1)
R.R. : Fr 2 ,k 1
P val : P( 2 Fr )
0mg
36.05
52.47
56.55
45.2
35.25
66.38
40.57
57.15
28.34
5mg
42.47
85.15
63.2
52.1
66.2
73.25
44.5
57.17
35.05
9mg
51.5
65
73.1
64.4
57.45
76.49
40.55
66.47
33.17
13mg
37.55
59.3
79.12
58.33
70.54
69.47
46.48
66.35
36.2
Ranks
Total
0mg
1
1
1
1
1
1
2
1
1
10
5mg
3
4
2
2
3
3
3
2
3
25
9mg
4
3
3
4
2
4
1
4
2
27
13mg
2
2
4
3
4
2
4
3
4
28
H 0 : No Dose Differences
H a : Dose Differences Exist
12
26856
2
2
T .S . : Fr
(10) (28) 3(9)(4 1)
135 14.2
9(4)(4 1)
180
R.R.( 0.05) : Fr .205, 41 7.815
P - value : P ( 2 14.2) .0026 (From EXCEL)
Conclude Means (Medians) are not all equal
DF
A
B
C
D
PF
B
C
D
A
DR
C
D
A
B
PR
D
A
B
C
yijk k i k ijk
Overall Mean
y ...
^
i y i.. y ...
^
ijk
df t 2 1
dfT t 1
df R t 1
df C t 1
H0: 1 = = t = 0
df E (t 2 1) 3(t 1) (t 1)(t 2)
2 MSE
t
Conclude i j if y i. y j . Bij
MSELS
(t 1) MSE
2-Way ANOVA
2 nominal or ordinal factors are believed to
be related to a quantitative response
Additive Effects: The effects of the levels of
each factor do not depend on the levels of
the other factor.
Interaction: The effects of levels of each
factor depend on the levels of the other
factor
Notation: ij is the mean response when
factor A is at level i and Factor B at j
i 1,..., a
j 1,..., b k 1,..., r
Overall Mean
i Effect of i th level of factor A
j Effect of j th level of factor B
ij Interaction effect when i th level of A and j th level of B are combined
ijk Random Error Terms
i 0,
i 1
j 0
j 1
ij 0 j
i 1
~
N
0
,
ij
ijk
b
j 1
Thalidomide/TB+: 9,6,4.5,2,2.5,3,1,1.5
Thalidomide/TB-: 2.5,3.5,4,1,0.5,4,1.5,2
Placebo/TB+: 0,1,-1,-2,-3,-3,0.5,-2.5
Placebo/TB-: -0.5,0,2.5,0.5,-1.5,0,1,3.5
ANOVA Approach
Total Variation (TSS) is partitioned into 4
components:
Factor A: Variation in means among levels of A
Factor B: Variation in means among levels of B
Interaction: Variation in means among combinations
of levels of A and B that are not due to A or B alone
Error: Variation among subjects within the same
combinations of levels of A and B (Within SS)
Analysis of Variance
a
df Total abr 1
df A a 1
df B b 1
df E ab( r 1)
df AB (a 1)(b 1)
Procedure:
First test for interaction effects
If interaction test not significant, test for Factor A and B effects
Test for Interaction :
H 0 : 11 ... ab 0
H a : Not all ij 0
H a : Not all i 0
H a : Not all j 0
MSAB
MSE
F ,( a 1)(b 1),ab ( r 1)
TS : FAB
RR : FAB
MSA
MSB
TS : FB
MSE
MSE
RR : FA F ,( a 1),ab ( r 1) RR : FB F ( b 1),ab ( r 1)
TS : FA
Group Means
tb
7.5
Negative
Positive
3.000
2.000
5.0
2.5
0.0
-2.5
1.000
0.000
-1.000
Placebo
Placebo
Thalidomide
Thalidomide
drug
drug
Report
WTGAIN
GROUP
TB+/Thalidomide
TB-/Thalidomide
TB+/Placebo
TB-/Placebo
Total
Mean
3.688
2.375
-1.250
.688
1.375
N
8
8
8
8
32
Std. Deviation
2.6984
1.3562
1.6036
1.6243
2.6027
F
10.206
16.887
24.502
.218
5.897
Sig.
.000
.000
.000
.644
.022
MSE
Wij q (b, v)
ar
i j if y .i. y . j . W ijB
( i j ) : y .i. y . j . WijB
2 MSE
br
2 MSE
ar
i j if y .i. y . j . B ijB
( i - j ) : y .i. y . j . B ijB
2 MSE
r
Bonferroni' s CI : (i - j ) : y ik . y jk . B ijA
Miscellaneous Topics
2-Factor ANOVA can be conducted in a Randomized
Block Design, where each block is made up of ab
experimental units. Analysis is direct extension of
RBD with 1-factor ANOVA
Factorial Experiments can be conducted with any
number of factors. Higher order interactions can be
formed (for instance, the AB interaction effects may
differ for various levels of factor C).
When experiments are not balanced, calculations are
immensely messier and you must use statistical
software packages for calculations
(Independent)
Procedure:
First test for interaction effects
If interaction test not significant, test for Factor A and B effects
Test for Interaction :
2
H 0 : ab
0
H 0 : 1 ... a 0
H 0 : b2 0
2
H a : ab
0
H a : Not all i 0
H a : b2 0
MSAB
MSE
F ,( a 1)(b 1),ab ( r 1)
TS : FAB
RR : FAB
MSA
MSB
TS : FB
MSAB
MSAB
RR : FA F ,( a 1),( a 1)(b 1) RR : FB F ,(b 1),( a 1)(b 1)
TS : FA
2 MSAB
br
(Independent)
(Independent)
Procedure:
First test for interaction effects
If interaction test not significant, test for Factor A and B effects
Test for Interaction :
2
H 0 : ab
0
2
H a : ab
0
MSAB
MSE
F ,( a 1)(b 1),ab ( r 1)
TS : FAB
RR : FAB
H 0 : a2 0
H 0 : b2 0
H a : a2 0
H a : b2 0
MSA
MSB
TS : FB
MSAB
MSAB
RR : FA F ,( a 1),( a 1)(b 1) RR : FB F ( b 1),( a 1)(b 1)
TS : FA
Nested Designs
Designs where levels of one factor are nested (as
opposed to crossed) wrt other factor
Examples Include:
where :
Yijk Response for k th rep of Factor A at i th level, B at jth level within A
Overall Mean
i Effect of i th level of A (Fixed or Random)
j (i ) Effect of jth level of B within i th level of A (Fixed or Random)
ijk Random error term for k th rep when A is at i, B is at j(i)
dfTotal r bi 1
i 1
Factor A :
df A a 1
SSB ( A) r Y ij . Y i..
i 1 j 1
df B ( A) bi a
i 1
Error :
a
bi
SSE Yijk Y ij .
i 1 j 1 k 1
df E (r 1) bi
i 1
i 1
bi
j 1
j (i )
0 i 1,..., a ijk ~ N 0, 2
H A : Not all j ( i ) 0
MSB( A)
P - value : P F FB ( A)
MSE
Rejection Region : FB ( A) F , b a ,( r 1) b
i
i
Test Statistic : FB ( A)
2 rbi rb j
A
MSE
rb rb
j
i
W ij ( k )
MSE
q (bk , v)
r
2
MSE
r
~
N
0
,
~
N
0
,
i
j (i )
b
ijk
a
i 1
H A : b2 0
MSB( A)
P - value : P F FB ( A)
MSE
Rejection Region : FB ( A) F , b a ,( r 1) b
i
i
Test Statistic : FB ( A)
2
rbi rb j
A
MSB( A)
rb rb
j
i
H A : b2 0
MSB( A)
P - value : P F FB ( A)
MSE
Rejection Region : FB ( A) F , b a ,( r 1) b
i
i
Test Statistic : FB ( A)
Examples
Agriculture: Varieties of a crop or gas may need to be
grown in large areas, while varieties of fertilizer or
varying growth periods may be observed in subsets of
the area.
Engineering: May need long heating periods for a
process and may be able to compare several
formulations of a by-product within each level of the
heating factor.
Behavioral Sciences: Many studies involve repeated
measurements on the same subjects and are analyzed as
a split-plot (See Repeated Measures lecture)
Design Structure
Blocks: b groups of experimental units to be exposed
to all combinations of whole plot and subplot factors
Whole plots: a experimental units to which the whole
plot factor levels will be assigned to at random within
blocks
Subplots: c subunits within whole plots to which the
subplot factor levels will be assigned to at random.
Fully balanced experiment will have n=abc
observations
i 1
b j ~ NID (0, b2 )
2
( ab) ij ~ NID (0, ab
)
c
k 1
( )
i 1
ik
( ) ik 0
k 1
MSWP
MS BLOCK *WP
MS SP
MS ERROR
MSWP SP
MS ERROR
i ..
Y i '.. t
2MS BLOCK WP
bc
2MS ERROR
ab
Sub Plot Effects Within same whole plot (Interaction) :
95% CI for ( k k ' ) :
..k
Y ..k ' t
i .k
Y i .k ' t
2MS ERROR
b
Y i '.k t
i .k
2 MS BLOCK WP (c 1) MS ERROR
bc
(c 1) MS ERROR MS BLOCK WP 2
(c 1) MS ERROR 2 MS BLOCK WP 2
a (b 1)(c 1)
(a 1)(b 1)
Model
Yijk i b j (i ) k ( ) ik ijk
overall mean
i effect of trt i
i 1
k 1
( )
i 1
ik
( ) ik 0
k 1
MSTRTS
MS SUBJECTS (TRTS )
PTRTS P ( F FTRTS | F ~ Fa 1, a ( n 1) )
Time Effects : H 0 : 1 t 0
Test Statistic : FTIME
MSTIME
MS ERROR
MSTRT TIME
MS ERROR
i ..
Y i '.. t
2MS ERROR
..k
an
Comparing Treatment Levels Within Time Levels :
i.k
Y i '.k t
Y ..k ' t
with approximate df :
^
(t 1)MS
a(n 1)
a(n 1)(t 1)