
11.2 One-Way ANOVA 413
MSE =
1
N −k
k
X
i=1
n
i
X
j=1
(y
i j
− y
i
)
2
=
1
N −k
k
X
i=1
"
(n
i
−1)
1
n
i
−1
n
i
X
j=1
(y
i j
− y
i
)
2
#
=
1
N −k
k
X
i=1
(n
i
−1)s
2
i
, and
E(MSE) =
1
N −k
k
X
i=1
(n
i
−1)E(s
2
i
) =
1
N −k
k
X
i=1
(n
i
−1)σ
2
=σ
2
.
On the other hand, mean square error due to treatments,
MST r
=
SSTr
k −1
=
1
k −1
k
X
i=1
n
i
(y
i
− y)
2
,
is an unbiased estimator of
σ
2
only when H
0
is true, that is, when all µ
i
are
the same. This follows from the fact that
E(MST r) =σ
2
+
P
i
n
i
(α
i
)
2
k −1
,
where
α
i
= µ
i
−µ is the population effect of treatment i. Since under H
0
α
1
= α
2
= ··· = α
k
= 0, the E(MSE) is equal to σ
2
, and MSTr is an unbiased
estimator of variance. When H
0
is violated, not all α
i
are 0, or, equivalently,
P
α
2
i
> 0. Thus, the ratio MST r/MSE quantifies the departure from H
0
, and
large values of this ratio are critical.
Example 11.1. Coagulation Times. To illustrate the one-way ANOVA we
work out an example involving coagulation times that is also considered by
Box et al. (2005). Twenty-four animals are randomly allocated to 4 different
diets, but the numbers of animals allocated to different diets are not the same.
The blood coagulation time is measured for each animal. Does diet type sig-
nificantly influence the coagulation time? The data and MATLAB solution are
provided next.
times = [62, 60, 63, 59, 63, 67, 71, 64, 65, 66, 68, 66, ...
71, 67, 68, 68, 56, 62, 60, 61, 63, 64, 63, 59];
diets = {’dietA’,’dietA’,’dietA’,’dietA’,’dietB’,’dietB’,...
’dietB’,’dietB’,’dietB’,’dietB’,’dietC’,’dietC’,’dietC’,...
’dietC’,’dietC’,’dietC’,’dietD’,’dietD’,’dietD’,’dietD’,...
’dietD’,’dietD’,’dietD’,’dietD’};
[p,table,stats] = anova1(times, diets,’on’)
% p = 4.6585e-005
% table =
%’Source’ ’SS’ ’df’ ’MS’ ’F’ ’Prob>F’
%’Groups’ [228] [ 3] [ 76] [13.5714] [4.6585e-005]
%’Error’ [112] [20] [5.6000] [] []