Lecture 8 ANOVA
Lecture 8 ANOVA
Lecture 8 ANOVA
ANOVA
Analysis of variance (ANOVA) is a method of testing
the equality of three or more population means by
analyzing sample variances.
Type
Dependent Variable
(Numerical)
Independent variables
(Categorical)
One way
Exam marks
Two way
Exam marks
Two factors
Gender
Race
Multifactorial
Exam marks
Assumption
The population under study have normal
distributions
The samples are drawn randomly
Each sample is independent of the other
sample
Equal population variances
Experimental design:
For the effective use of ANOVA, experiment has to
be standardized in terms of the randomness and
replications of all variables, including samples,
surrounding and trial protocol.
The experimental design has to be standardized to
reduce the error of all variables mentioned above.
A
D
F
D
B
B
E
A
F
C
E
F
C
D
F
C
E
B
A
C
E
A
B
D
Block I
D
E
F
B
B
C
D
A
F
E
E
C
D
Block III
F
B
F
A
Block IV
C
D
E
1.
DF
SS
MS
Fobserved
Ftabulated
5%
Treatment
Error/residual
Total
SS = sum of squares
MS = mean square; MS treatment=SStreatment/DFtreatment..
Fobserved= MStreatment/MSerror
1%
2.
Define and HA
Ho: All means are the same value
HA: There are means which are not the same
3. Determine Source of variation
4. Determine D of F for each source
5. Determine CF
6. Determine SS
7. Determine MS (=SS/D of F)
8. Calculate Fcalculated
9. Obtain Ftabulated from Table-F
10. Compare Ftabulated with Fcalculated
If Fcalculated > Ftabulated reject Ho
If Fcalculated < Ftabulated
accept Ho
Malay
Mean
BMI
Chinese
Indian
Unpaired t test
I
Increase
type I
error!!!!!
Unpaired t test II
Unpaired t test III
ANOVA
Treatment
RS1
2537
2069
2104
1797
RS2
3366
2591
2211
2544
RS3
2536
2459
2827
2385
RS4
2387
2453
1556
2116
RS5
1997
1679
1649
1859
RS6
1796
1704
1904
1320
Control
1401
1516
1270
1077
Hypothesis:
Ho: All means are the same value
i.e. 1=2=3=4=5=6=control
HA: There are means which are not the same
Source of
Variation*
DF
Treatment
Error
21
Total
27
SS
MS
Fcalculated
Ftabulated
5%
1%
Treatment
Total
Mean
RS1
2537
2069
2104
1797
8507
2127
RS2
3366
2591
2211
2544
10712
2678
RS3
2536
2459
2827
2385
10207
2552
RS4
2387
2453
1556
2116
8512
2128
RS5
1997
1679
1649
1859
7184
1796
RS6
1796
1704
1904
1320
6724
1681
Control
1401
1516
1270
1077
5264
1316
Grand total
Grand Mean
57110
2040
Source
of DF
Variation
SS
Treatment
5,587,175
931,196
Error
21
1,990,246
94,773
Total
27
7,577,421
MS
Fcalculated
9.82
Ftabulated
5%
1%
2.57
3.81
Ftotal = MStreatment/MSerror
Ftable = F (dftreatment, dferror) at a significance level of
= F (x , y) at a significance level of from
Fischers Table
Ho is rejected. There are differences among the means........
Yield (g m-2)
R1
R2
R3
R4
R5
B1
86
79
81
70
84
B2
90
76
88
82
89
B3
82
68
73
71
81
Ho: B1=B2=B3
H1: There are mean which are not the same
Fertilizer type
Yield (g m-2)
Total
Mean
R1
R2
R3
R4
R5
B1
86
79
81
70
84
400
80
B2
90
76
88
82
89
425
85
B3
82
68
73
71
81
375
75
Total
1200
CF = (1200)2/15= 96,000
SStotal = [(86)2 + (79)2 +........+(71)2 +( 812) ]- CF= 698
SStreatment = (400)2 + (425)2 + (375)2) CF = 250
5
SSerror = SStotal - SStreatment = 698-250=448
Jadual Piawai ANOVA:
Source of variation
DF
SS
MS
Fcalculated
F(2,12)
5%
1%
treatment
error
total
Accept Ho. All means are the same, the fertilizers do not give any effect on
the yield of peanut.
Paddy
25
50
75
100
125
150
5,113
5,346
5,272
5,164
4,804
5,254
Block I
Ho: 1=2=3=4=5=6
HA: 1 2 3 4 5 6
Ho: b1=b2=b3=b4
HA: b1 b2 b3 b4
yield
(kg/ha)
Block II
Block III
Block IV
5,398
5,952
5,713
4,831
4,848
4,542
5,307
4,719
5,483
4,986
4,432
4,919
4,678
4,264
4,749
4,410
4,748
4,098
Treatment (kg
seed/ha)
Paddy yield
(kg/ha)
Treatment
Block I
Block II
Block III
Block IV
total
Mean
25
50
75
100
125
150
5,113
5,346
5,272
5,164
4,804
5,254
5,398
5,952
5,713
4,831
4,848
4,542
5,307
4,719
5,483
4,986
4,432
4,919
4,678
4,264
4,749
4,410
4,748
4,098
20,496
20,281
21,217
19,391
18,832
18,813
5,124
5,070
5,304
4,848
4,708
4,703
T Block
30,953
31,284
29,846
26,947
G Total
119,030
G Mean
M Block
4,960
5158.8
5214.0
4974.3
4491.2
CF = (119030)2/24 = 590,339,204
SStotal = [(5113)2+(5398)2+.........+(4098)2] CF
= 4,801,068
SSblock = (30953)2 + (31284)2 + (29846)2 +(26947)2 - CF
6
= 1,944,361
SStreatment = (20496)2 + (20281)2 +.......+(18813)2 - CF
4
= 1,198,331
SSerror = SStotal SSblock SStreatment
= 4,801,068 1,944,361 1,198,331
= 1,658,376
DF
SS
Block
Treatment
Error
3
5
15
1,944,361
1,198,331
1,658,376
Total
23
4,801,068
MS
648,120
239,666
110,558
Fcalculated
5.86**
2.17n.s.
Ftable
5%
1%
3.29
2.90
5.42
4.56
Exercise
Four researchers (P I P IV) were asked to measure the photosynthesis rate in
an extensive experiment which involved five light treatments (T1- T5).
Results was reported as follows:
Light
treatment
P II
P III
P IV
T1
3.8
2.9
1.1
3.6
T2
6.7
6.8
3.2
7.0
T3
9.9
10.1
6.1
10.2
T4
12.5
11.8
7.4
13.0
T5
13.1
14.0
8.2
14.1
PI
P II
P III
P IV
T1
3.8
2.9
1.1
3.6
T2
6.7
6.8
3.2
T3
9.9
10.1
6.1
10.2
T4
12.5
11.8
7.4
13
T5
13.1
14
8.2
14.1
46
45.6
26
47.9
CF
SS total
SSblock
SStreatment
SV
DF
SS
MS
F t (1%)
Block
treatment
error
Total
Conclusion:
Among light treatments: there are differences between mean (accept HA)
Among the researchers (Block): there are differences between mean (accept HA)
Further step that is LSD test is carried out to determine which pairs are
significantly different. If the treatments were conducted with the same no.
replications (=r), the formula to calculate LSD at the significance level of
is as follows:
LSD = t (2MSe/r)
Treatment
RS1
2537
2069
2104
1797
RS2
3366
2591
2211
2544
RS3
2536
2459
2827
2385
RS4
2387
2453
1556
2116
RS5
1997
1679
1649
1859
RS6
1796
1704
1904
1320
Control
1401
1516
1270
1077
Hypothesis:
Ho: All means are the same value
i.e. 1=2=3=4=5=6=control
HA: There are means which are not the same
Interpretation of Result
If the difference between means > LSD
The different is significant at a significance level of
If the difference between means < LSD
The different is not significant at a significance level of
Example 1: A trial on pesticides (CRD)
Source of
variation
DF
SS
MS
Fobserved
Ftabulated
5%
Treatment
5,587,175
931,196
Error
21
1,990,246
94,773
Total
27
7,577,421
9.82
1%
2.57 3.81
Conclusion:
Treatment
Mean
Significant
RS2
2678
1362
**
RS3
2552
1236
**
RS4
2128
812
**
RS1
2127
811
**
RS5
1796
480
RS6
1681
365
ns
Control
1316
** significant at 1%
* significant at 5%
ns, the difference is not significant
DF
SS
MS
Ftabulated 1%
Block
63
21
36.2
5.95
Treatment
242
60.5
104.3
5.41
Error
12
0.58
Total
19
312
T1
mean
Significant
vs.
T2
3.08
**
T1 vs.
T3
6.23
**
T2
T3
3.15
**
T5
1.17
n.s.
vs.
.......
........
........
T4
vs.
Concl:
....
LSD for block = 1.65
......
on the table above, only the mean pair of T4 and T5 does not show a
significant difference at significant level of 1%. Other mean pairs show
significant differences.
3.
4.
5.
Arrange Rp in sequence next to its mean. (Rp must follow the mean
sequence i.e. descending order)
Calculate D = (Mean Rp) . Draw a conclusion (see the following
examples)
treatment
RS1
2537
2069
2104
1797
RS2
3366
2591
2211
2544
RS3
2536
2459
2827
2385
RS4
2387
2453
1556
2116
RS5
1997
1679
1649
1859
RS6
1796
1704
1904
1320
Control
1401
1516
1270
1077
Source
variation
of
DF
SS
MS
treatment
5,587,175
931,196
error
21
1,990,246
94,773
total
27
7,577,421
Fcalculated
9.82
Ftabulated
5%
1%
2.57
3.81
DMRT method:
Sx = (MSe/r) = (94773/4) = 153.93
Rp = rp Sx
rp from table New Multiple Range Test for p= 2-7 (df =21) at significance
level of 5%as follows:
rp
Rp = rp Sx
2.94
453
3.09
476
3.18
490
3.25
500
3.30
508
3.33
513
treatment
Mean
Rp
D
Mean - Rp
RS2
2678 a
513
2165
RS3
2552 ab
508
2044
RS4
2128 bc
500
1628
RS1
2127 bc
490
1637
RS5
1796
476
1320
RS6
1681
cd
453
1228
Control
1316
For RS2 treatment, assume all means >2165 as same with this mean treatment. Thus,
mean treatments RS2 and RS3 are the same. These means are given same symbol
(i.e. a).
For RS3 treatment, assume all means >2044 as same with this mean treatment. Thus,
mean treatments RS3, RS4 and RS1 are the same. These means are given same
symbol (i.e. b).
For RS4 treatment, assume all means >1628 as same with this mean treatment. Thus,
mean treatments RS4, RS1, RS5 and RS6 are the same. These means are given
same symbol (i.e. c).
For RS1 treatment, assume all means >1637 as same with this mean treatment. Thus,
mean treatments RS1, RS5 and RS6 are the same.
Next, for RS5 treatment, assume all means >1320 as same with this mean treatment.
Thus, mean treatments RS5 and RS6 are the same.
Lastly, for RS6 treatment, assume all means >1228 as same with this mean treatment.
Thus, mean treatments RS6 and control are the same. These means are given same
symbol (i.e. d).
Conclusion:
Treatment
Mean
RS2
2678 a
RS3
2552 ab
RS4
2128 bc
RS1
2127 bc
RS5
1796 c
RS6
1681 cd
Kawalan
1316 d
R1
R2
R3
R4
H1
87
79
83
92
H2
80
73
75
71
H3
94
87
90
92
SV
DF
SS
MS
Fcalculated
Ftable (0.01)
treatment
529
265
14.6
7.56
error
164
18.2
total
11
693
Using ANOVA, test whether the hormonal treatment gives different yield
at a significance level of 1%:
Conclusion: Fcalculated > Ftabulated. There are differences among the means, but
we dont know which treatments.
To solve this problem, used LSD or DMRT.
LSD method
LSD = t (2MSe/r)
LSD 0.01 = t 0.005 x (2 x 18.2)/4 = 3.25 x 9.1 = 9.8
Conclusion:
..........
mean
Mean
treatment
Significant
H1 & H2
10.5
**
H1 & H3
5.5
n.s.
H2 & H3
16
**
DMRT method
Sx = (MSe/r) = (18.2)/4 = 2.13
*
Rp = rp
Sx
rp
4.60
9.8
4.86
10.4
Mean
Rp
D
Mean - Rp
H3
90.8 a
10.4
80.4
H2
85.3 a
9.8
75.5
H1
74.7 b
Conclusion...........................
Error
Protection
df
level
10
11
12
13
14
P=
number
of
means
for
range
being
tested
10
12
14
16
18
20
0.05
18.0
18.0
18.0
18.0
18.0
18.0
18.0
18.0
18.0
18.0
18.0
18.0
18.0
18.0
0.01
90.0
90.0
90.0
90.0
90.0
90.0
90.0
90.0
90.0
90.0
90.0
90.0
90.0
90.0
0.05
6.09
6.09
6.09
6.09
6.09
6.09
6.09
6.09
6.09
6.09
6.09
6.09
6.09
6.09
0.01
14.0
14.0
14.0
14.0
14.0
14.0
14.0
14.0
14.0
14.0
14.0
14.0
14.0
14.0
0.05
4.50
4.50
4.50
4.50
4.50
4.50
4.50
4.50
4.50
4.50
4.50
4.50
4.50
4.50
0.01
8.26
8.5
8.6
8.7
8.8
8.9
8.9
9.0
9.0
9.0
9.1
9.2
9.3
9.3
0.05
3.93
4.01
4.02
4.02
4.02
4.02
4.02
4.02
4.02
4.02
4.02
4.02
4.02
4.02
0.01
6.51
6.8
6.9
7.0
7.1
7.1
7.2
7.2
7.3
7.3
7.4
7.4
7.5
7.5
0.05
3.64
3.74
3.79
3.83
3.83
3.83
3.83
3.83
3.83
3.83
3.83
3.83
3.83
3.83
0.01
5.70
5.96
6.11
6.18
6.26
6.33
6.40
6.44
6.5
6.6
6.6
6.7
6.7
6.8
0.05
3.46
3.58
3.64
3.68
3.68
3.68
3.68
3.68
3.68
3.68
3.68
3.68
3.68
3.68
0.01
5.24
5.51
5.65
5.73
5.81
5.88
5.96
6.0
6.0
6.1
6.2
6.2
6.3
6.3
0.05
3.35
3.47
3.54
3.58
3.60
3.61
3.61
3.61
3.61
3.61
3.61
3.61
3.61
3.61
0.01
4.95
5.22
5.37
5.45
5.53
5.61
5.69
5.73
5.8
5.8
5.9
5.9
6.0
6.0
0.05
3.26
3.39
3.47
3.52
3.55
3.56
3.56
3.56
3.56
3.56
3.56
3.56
3.56
3.56
0.01
4.74
5.00
5.14
5.23
5.23
5.40
5.47
5.51
5.5
5.6
5.7
5.7
5.8
5.8
0.05
3.20
3.34
3.41
3.47
3.50
3.52
3.52
3.52
3.52
3.52
3.52
3.52
3.52
3.52
0.01
4.60
4.86
4.99
5.08
5.17
5.25
5.32
5.36
5.4
5.5
5.5
5.6
5.7
5.7
0.05
3.15
3.30
3.37
3.43
3.46
3.47
3.47
3.47
3.47
3.47
3.47
3.47
3.47
3.48
0.01
4.48
4.73
4.88
4.96
5.06
5.13
5.20
5.24
5.28
5.36
5.42
5.48
5.54
5.55
0.05
3.11
3.27
3.35
3.39
3.43
3.44
3.45
3.46
3.46
3.46
3.46
3.46
3.47
3.48
0.01
4.39
4.63
4.77
4.86
4.94
5.01
5.06
5.12
5.15
5.24
5.28
5.34
5.38
5.39
0.05
3.08
3.23
3.33
3.36
3.40
3.42
3.44
3.44
3.46
3.46
3.46
3.46
3.47
3.48
0.01
4.32
4.55
4.68
4.76
4.81
4.92
4.96
5.02
5.07
5.13
5.17
5.22
5.24
5.26
0.05
3.06
3.21
3.30
3.35
3.38
3.41
3.42
3.44
3.45
3.45
3.46
3.46
3.47
3.47
0.01
4.26
4.48
4.62
4.69
4.74
4.84
4.88
4.94
4.98
5.04
5.08
5.13
5.14
5.15
0.05
3.03
3.18
3.27
3.33
3.37
3.39
3.41
3.42
3.44
3.45
3.46
3.46
3.47
3.47
0.01
4.21
4.42
4.55
4.63
4.70
4.78
4.83
4.87
4.91
4.96
5.00
5.04
5.06
5.07
15
16
17
18
19
20
22
24
30
60
0.05
3.01
3.16
3.25
3.31
3.36
3.38
3.40
3.42
3.43
3.44
3.45
3.46
3.47
3.47
0.01
4.17
4.37
4.50
4.58
4.64
4.72
4.77
4.81
4.84
4.90
4.94
4.97
4.99
5.00
0.05
3.00
315
3.23
3.30
3.34
3.37
3.39
3.41
3.43
3.44
3.45
3.46
3.47
3.47
0.01
4.13
4.34
4.45
4.54
4.60
4.67
4.72
4.76
4.79
4.84
4.88
4.91
4.93
4.94
0.05
2.98
3.13
3.22
3.28
3.33
3.36
3.38
3.40
3.42
3.44
3.45
3.46
3.47
3.47
0.01
4.10
4.30
4.41
4.50
4.56
4.63
4.68
4.72
4.75
4.80
4.83
4.86
4.88
4.89
0.05
2.97
3.12
3.21
3.27
3.32
3.35
3.37
3.39
3.41
3.43
3.45
3.46
3.47
3.47
0.01
4.07
4.27
4.38
4.46
4.53
4.59
4.64
468
4.71
4.76
4.79
4.82
4.84
4.85
0.05
2.96
3.11
3.19
3.26
3.31
3.35
3.37
3.39
3.41
3.43
3.44
3.46
3.47
3.47
0.01
4.05
4.24
4.35
4.43
4.50
4.56
4.61
4.64
4.67
4.72
4.76
4.79
4.81
4.82
0.05
2.95
3.10
3.18
3.25
3.30
3.34
3.36
3.38
3.40
3.43
3.44
3.46
3.46
3.47
0.01
4.02
4.22
4.33
4.40
4.47
4.53
4.58
4.61
4.65
4.69
4.73
4.76
4.78
4.79
0.05
2.93
3.08
3.17
3.24
3.29
3.32
3.35
3.37
3.39
342
3.44
3.45
3.46
3.47
0.01
3.99
4.17
4.28
4.36
4.42
4.48
4.53
4.57
4.60
4.65
4.68
4.71
4.74
4.75
0.05
2.92
3.07
3.15
3.22
3.28
3.31
3.34
3.37
3.38
3.41
3.44
3.45
3.46
3.47
0.01
3.96
4.14
4.24
4.33
4.39
4.44
4.49
4.53
4.57
4.62
4.64
4.67
4.70
4.72
0.05
2.89
3.04
3.12
3.20
3.25
3.29
3.32
3.35
3.37
3.40
3.43
3.44
3.46
3.47
0.01
3.89
4.06
4.16
4.22
4.32
4.36
4.41
4.45
4.48
4.54
4.58
4.61
4.63
4.65
0.05
2.83
2.98
3.08
3.14
3.20
3.24
3.28
3.31
3.33
3.37
3.40
3.43
3.45
3.47
0.01
3.76
3.92
4.03
4.12
4.17
4.23
4.27
4.31
434
4.39
4.44
4.47
4.50
4.53