 |
Table of Contents
In Modules 10 and 11, we considered situations where data were collected
from
different populations. Comparisons between the
populations
means were of interest. To model such data, we defined a factor-a
categorical variable with levels indicating, for each observation, which of
the populations it came from. But suppose that each observation can be
categorised according to two or more factors. For example, in
pharmaceutical experiments, the treatments involved may differ in terms of
the type of drug (first factor), and the dose of the drug (second factor).
In farming, the yield of a particular barley field may depend on the variety
of barley, and on the type of fertilizer. In a social study of crime rates,
factors such as level of urbanity (rural, suburban, urban), wealth of
neighbourhood (poor, average, rich), time of year, etc. may be taken
into account. Such experiments or studies are called factorial
experiments because we are interested in the effects of two or more factors
on the response variable. This module and Module 13 are concerned with
factorial experiments.
Note that, if we are only interested in one of the factors in a two-factor
experiment-that is, the other factor is an extraneous variable-and if
certain additional assumptions are satisfied, we have a randomised
complete block design, as discussed in Module 10.
In Section 12.2, we discuss some important features related to factorial
experiments, and we define a model for data from such experiments. A method
for analysing factorial experiments is presented in Section 12.3.
In factorial experiments, the data can be split into sub-samples
corresponding to each possible combination of levels of the different
factors. The effects of the factors can be analysed by comparing the
different sub-samples appropriately. In this section, we introduce some
terminology and define a model for factorial experiments.
Example 12.1 Reducing stress
An experiment was made to investigate whether the drugs levorphanol and
epinephrine can be used to reduce stress. Each treatment (Treatment 1:
levorphanol, Treatment 2: levorphanol and epinephrine, Treatment 3:
epinephrine, and Treatment 4: a control group, receiving neither drug) was
given to five animals, and the cortical sterone level (which reflects the
stress-level) was measured. The data are given in the table below.
Note that each cell in the table contains the data which corresponds to a
particular combination of factor levels. For example the upper-left cell
corresponds to animals receiving both levorphanol and epinephrine,
whilst the lower-left cell corresponds to animals receiving only
epinephrine, etc.
Further details on this dataset can be found here.
In Example 12.1, the two factors `presence or absence of levorphanol' and
`presence or absence of epinephrine' are both fixed factors. In this module,
we shall concentrate on models where all factors are fixed. Such models are
called fixed-effects models. In Module 13, we shall discuss mixed-effects models, which contain both fixed and random factors. Another
feature of Example 12.1 is that all cells in the table have the same number
of observations. Experiments for which all cells have the same number of
observations are called balanced experiments. In this module, we
shall only consider situations with the same number of observations in each
cell. (Situations where the cell numbers are different are considered in
Module 13.)
The ideas of main effects and interactions are discussed in
Subsection 12.2.1, and a model for data from factorial experiments is given
in Subsection 12.2.2.
Consider again the data in Example 12.1.
Example 12.1 (continued) Reducing stress
The data table suggests that the cortical sterone level differs for the four
groups. We could use a one-way ANOVA to test for equality of means in the
four groups, and Tukey's method to compare the four groups with each other.
However, suppose we wish to investigate the main effect of each drug,
that is, `Does levorphanol have an overall effect on the mean cortical
sterone level?', `Does epinephrine?'; or the interaction between the
drugs, that is, `Does levorphanol affect the mean cortical sterone level in
the same way, whether or not the animal receives epinephrine as well?' (Or,
equivalently, `Does epinephrine affect the mean cortical sterone level in
the same way, whether or not the animal receives levorphanol as well?')
This type of questions can be re-phrased in terms of contrasts. (Recall the
concept of contrasts from Module 10.) Denote by
the mean
cortical sterone level for animals receiving both levorphanol and
epinephrine,
for animals only receiving levorphanol,
for animals receiving only epinephrine, and
for the control
group, receiving neither drug. (Note that the subscripts
and
denote
presence of levorphanol and epinephrine, respectively, and
and
denote absence of the same drugs, respectively.) Then
is a measure of the effect of the drug levorphanol on animals who
receive the additional drug epinephrine, and
is a
measure of the effect of levorphanol on animals who do not receive
epinephrine. Thus, the contrast
 |
(12.1) |
is a measure of the average (or, overall) effect of levorphanol. (Note that
is a contrast since
.) Likewise, the contrast
is a measure of the average (or, overall) effect of epinephrine. We can test
for main effects of levorphanol and epinephrine, respectively, by testing
the hypotheses
and
.
A contrast for measuring the interaction between the drugs can be
constructed using the following argument: If the effect of levorphanol is
the same whether or not epinephrine is given to the animal, then the two
differences
and
are the same.
Thus, their difference will be zero, thus
is a contrast measuring the interaction between the drugs. (It can be shown
that we get exactly the same contrast, if we swap epinephrine and
levorphanol in the above argument.)
In Example 12.1, the two factors each had only two levels, and each
main-effect could be expressed as a contrast. In general, suppose we have
two factors
and
with levels
and
, respectively. The main-effect of Factor
can be expressed as a set of
contrasts
, where the contrast
is
the difference between the average mean
of data with level
of Factor
, that is,
,
and the overall average mean
. (Here
denotes the mean of data with level
of Factor
and level
of
Factor
.) The
contrasts corresponding to the main-effect of Factor
are given by
If all the contrasts in (12.2) vanish:
there is no main-effect of Factor
, since the mean is the same for all
levels of the
-factor, that is,
 |
(12.3) |
or, equivalently,
since (12.3) implies that
The main-effects of Factor
can be expressed accordingly as
contrasts. There is no main-effect of Factor
if all the contrasts
corresponding to the
-factor are equal to zero:
The concept of factor main effects easily generalises to factorial
experiments with more than two factors.
Example 12.1 (continued) Reducing stress
For the data on cortical sterone level, the main effect of the drug
levorphanol can be expressed as a single contrast (since the factor has
levels). Using the general approach, an appropriate contrast (12.2) is given by
Note that this contrast is the same as the contrast in (12.1),
except that it is multiplied by 1/2. But since the interest in the main
effect is whether or not the contrast i zero, the contrast
and (12.1) are equivalent.
The second-order interaction between two factors is a contrast
which describes the way the effect of one factor depends on the level
of the other factor. In the simplest case, when both factors only have two
levels (such as in Example 12.1), the interaction is the difference in
effect of one factor, when the other factor changes level. (For instance,
in Example 12.1 is the interaction between the factors `levorphanol'
and `epinephrine'.) If one, or both, factors have more than two levels, the
mathematical formula for the interaction becomes a bit messy, but the
essence remains the same: the interaction describes the way the effect of
one factor depends on the levels of the other factor. We shall leave it to a
computer package to do the necessary calculations. If there are three
factors, we can consider the interactions between each pair of factors; but
also the third-order interaction, that is, the interaction between
all three factors: how does the effect of one factor depends on the levels
of the other two factors? Again, we shall leave it to a computer package to
do the mathematical calculations. (The concept of interaction easily
generalises to higher-order interactions when the number of factors
increases.)
As often before, it is very useful to start an analysis by plotting the data
in way that will give us a rough idea of the results we can expect from the
analysis. In the situations where we are investigating two factors, mean plots will indicate whether there are main effects of the factors,
and/or interaction between the two factors.
Example 12.1 (continued) Reducing stress
The mean plots of the data on stress-reducing drugs is shown in Figure 12.1.
Figure 12.1:
Mean plot for levorphanol and epinephrine
|
|
Figure 12.1 shows the sample means corresponding to the four
different treatments. In the plot the means are joined with lines according
to the levels of the factor `levorphanol' (level 0: solid line, level 1:
dashed line). That is, the bottom line corresponds to the treatments which
includes levorphanol, and the top line corresponds to the treatments which
do not include levorphanol. You can see from the plot that, for each level
of the epinephrine-factor, the drug levorphanol seems to reduce
the level of cortical sterone, and, for each level of the
levorphanol-factor, the drug epinephrine seems to increase the level of
cortical sterone.
However, epinephrine seems to increase the cortical sterone level less
when the animal receives levorphanol as well, than when the animal only
receives epinephrine. This suggests that there is an interaction between the
two factors corresponding to levorphanol and epinephrine, respectively.
Plots such as Figure 12.1 are called mean plots,
because we plot the means of the cells against each other, and join them
with lines according to the levels of one of the factors in order to find
out whether the factors interact. (Note that we can join the means according
to either factor. The choice does not affect the information we can get from
the plot about possible interaction between the factors). Figure 12.2 shows three situations with different kinds of interaction
between two factors-one factor (Factor
, along
-axis) has three
levels, the other (Factor B) has two levels (1: solid line, 2: dashed line).
Figure 12.2:
Interaction: (a) no interaction (b) and (c) interaction exists
|
|
In Figure 12.2(a), the lines are parallel. Hence, we can make
general statements about the effects of one factor independently of the
level of the other factor. For example, Figure 12.2(a)
suggests that the mean of the response variable is highest when Factor A has
level 2, and lowest when Factor A has level 1-irrespective of the level of
Factor B. Figures 12.2(b) and (c) show two examples where the
lines are not parallel. In such cases one cannot make general statements
about the effect of one factor without specifying the level of the other
factor. For example, in Figure 12.2(b), it seems that if
Factor B has level 1, the mean of the response variable is highest when
Factor A has level 2, but if Factor B has level 2, the mean of the response
variable is highest when Factor A has level 3.
Example 12.2 Different protein diets
Six groups, each of ten rats, were fed on diets which differed according to
the source of protein and the amount of protein in the diet. The weight gain
for each rat was recorded. The observations are given in the table below.
The factor corresponding to the protein source has three levels: beef (Level
1), cereal (Level 2) and pork (Level 3); and the factor corresponding to the
amount of protein has two levels: low (Level 1) and high (Level 2). Figure 12.3 shows a mean plot of the data.
Figure 12.3:
Mean plot for protein source and protein amount
|
|
The lines join the means according to the levels of the amount-factor (Level
1: solid line, Level 2: dashed line). The high-amount level appears to
produce higher weight gains throughout, whereas the protein source seems to
have less effect-whether the rats were on low amount diet or high amount
diet. However, there is some indication of a difference between the cereal
diets and the two meat diets. For rats on low-amount diets, the rats on
cereal diets appear to have the largest weight gain, whereas, for rats on
high diet, the rats on cereal diets appear to have the smallest weight gain.
Thus, there might be interaction between the two factors-but the
differences in means might simply be due to random variation.
Further details on this dataset can be found here.
We start by considering factorial experiments with two factors. It is common
to refer to one of the factors as the row factor and the other as
the column factor. The reason for these names is that the data are
usually presented in a table, such that each cell contains the data
corresponding to a specific level of each factor-the levels of the row
factor are listed as rows in the table, and the levels of the column factor
are listed as columns in the table. For instance, in Example 12.2, `Protein'
is the row factor, and `Amount' is the column factor. (Note that, if we
transpose the table, the row and column factors are swapped. Thus, the terms
row and column factor refer to the way the table of data is presented.)
Suppose that the row factor has
levels, and the column factor has
levels. (In Example 12.2,
and
.) Then the two-way ANOVA
model is given by
where
are independent normally distributed random
variables with zero mean and common variance
, and
is the
common sample size (in this module, we only consider situations where all
cells in the data table have the same number of observations). The
assumptions of the model can be checked by analysing the residuals. (See
Module 10.)
The five terms on the right-hand side in the model (12.4) have the
following interpretations:
is the overall mean effect,
corresponds to the effect of the row factor having
level
(here
denotes the
average mean of data with row-factor level
, where
is the
mean of the
th cell),
corresponds to the effect of the column factor having level
(where
denotes the average mean of data with
column-factor level
), the
s are the interaction effects
between the row factor and the column factor, and finally, the
s are random error terms. There is interaction between the row and
column factors if and only if
for at least one pair
If there is no interaction, the model has no row factor main effect if
and only if all the
s are zero. If there is no interaction, it
has no column factor main effect if and only if all the
s are
zero.
Note that, since the
s are the deviances between the mean when
row factor has level
and the average mean, the sum of the
s
is zero:
 |
(12.5) |
Likewise, the sum of the
s zero
 |
(12.6) |
Further, it can be shown that the interaction-terms
satisfy
the following
and  |
(12.7) |
The model (12.4) can be generalised to cater for factorial
experiments with three or more factors. Suppose that we have three factors
,
and
with
,
, and
levels, respectively. Then we can
use the three-way ANOVA model, given by
for
,
,
and
. This model has nine terms. Again,
is the overall mean
effect,
,
and
correspond to the main
effects of factors
,
and
, respectively. Further, the bracketed
terms denote interactions between the three factors:
is the interaction between factors
and
,
is the interaction between factors
and
,
is the interaction between factors
and
, and
is the second-order
interaction between factors
,
and
. Finally, the
s are independent normally distributed random error term with zero
mean and variance
.
If there are more than three factors, the model can be generalised in a
similar way. But beware that such a model-known as a multiway ANOVA
model-very quickly becomes very complicated to work with. In particular
when higher-order interactions exists. (The model assumptions can be checked
by investigating the observed residuals for the ANOVA model.)
Recall that, in Module 10 we came across a special case of the model (12.4) in connection with randomised complete block designs
(Section 10.3). In Module 10, one of the factors was treated as an
extraneous factor (a block) which we had no interest in. We further
assumed that the model was additive, i.e. that there is no
interaction between the factor of interest and the block, and we required
that there was only one single observation in each cell.
In this section, we shall test various hypotheses about multiway ANOVA
models. To keep notation simple, we shall concentrate on analysing two-way
ANOVA models, but the principles are easily generalised to multiway ANOVA
models. (One of the exercises for this module involves a three-way ANOVA.)
Recall that the two-way ANOVA model is given by
where
is the number of levels of the row factor,
is the number of
levels of the column factor,
is the common sample size, and the
s are independent normally distributed random error terms
with zero mean and common variance
. We shall further assume
that there are at least two observations in each cell. This
assumption is necessary in order to test for interaction between the factors.
The three null hypotheses of interest, are the following
 |
 |
There is no row factor main effect |
|
 |
 |
There is no column factor main effect |
|
 |
 |
There is no interaction between the row and column
factors. |
|
Note that, if the row and column factors interact (i.e. if
is rejected), then the two hypotheses concerning the main effects of the row
and column factors (that is,
and
, respectively) are
irrelevant: If there is significant interaction between the two factors,
then both factors do have an effect on the mean of the
response variable through the interaction terms-irrespective of whether or
not the main effects of the factors are significant.
We start by considering the null hypothesis of no interaction
.
This null hypothesis can be expressed in terms of the interaction terms
. If there is no interaction, all interaction terms
must be zero, that is,
 for all
If
is accepted, we can continue the analysis by testing
significance of the row and column factor main effects. However, if
is rejected, the effect of the row factor changes for the different levels
of the column factor (and vice versa). Thus, we cannot make any general
statements, or test hypotheses, about the main effects of one factor,
without taking the level of the other factor into account. In such
situations, one might analyse data by conditioning on one factor. For
example, if we condition on the row factor
, we have, for each
level
, a one-way ANOVA model
with
levels, corresponding to the levels of the column factor. Each of
the
models can be analysed seperately using a one-way ANOVA, e.g.
for the data on reducing stress in Example 12.1, we could analyse the effect
of levorphanol conditioned on presence of epinephrine, and the effect of
levorphanol conditioned on absence of epinephrine. An alternative way to
analyse data is using a single one-way ANOVA with
populations
corresponding to the
different combinations of factor levels. For example, for the data on reducing stress, we could ignore the fact the 4
treatments are linked through presence or absence of two different drugs,
and simply regard all 4 treatments as completely different. The data can
then be analysed using a one-way ANOVA with four factor-levels. (Note that,
by doing this, we are throwing some information on the data away. It is
better to use as much of the given information as possible, and only
consider a one-way ANOVA if
is rejected.)
If the hypothesis of no interaction is accepted, the model (12.8)
reduces to the additive model
where the
s are independent normally distributed random
error terms with zero mean and common variance
. Here,
corresponds to the overall mean effect,
to
the effect of the row factor having level
,
to the effect of the column factor having level
and
describes the random variation. We can now continue the
analysis by considering the hypotheses concerning the main effects of the
factors. The null hypothesis of no row factor main effect,
, can be
expressed in terms of the
s. If there is no row factor main
effect all the
s must be zero, that is
Similarly, the null hypothesis of no column factor main effect,
,
can be expressed in terms of the
s, by
We can test hypotheses such as
,
and
using a
two-way analysis of variance. In a two-way ANOVA, the total
unexplained variation in the data is split into four parts, according to the
source of the variation: the row factor effect, the column factor effect,
the interaction effect, and the unexplained residual variation. The total
unexplained variation in the data is given by the corrected sum of squares
of the responses
, that is,
where
is the estimator for the overall mean
. By decomposing
into a row factor-part
, a column factor-part
an interaction-part
, and a part due
to unexplained residual variation
, we get
where
,
,
and
.
We can construct a test statistic to test for no interaction
using arguments similar to the arguments we have
used in other ANOVA contexts: Start by supposing that
is false. That is, suppose that there exists at least one interaction term
which is different from zero. Then the interaction-part of the
total variation
should explain a significant amount of the
variation in the data, relative to the residual variation. That is, if
is false, we expect
to be large relative to
, and
thus, the ratio
will be large. The null hypothesis of no interaction
is rejected for large values of
. It can be shown
has an
distribution, if
is true.
The test statistic
can be found using a two-way ANOVA table. A two-way ANOVA table is fairly similar to the ANOVA tables we
have met before: It contains degrees of freedom, sum of squares, mean
squares,
-statistic and corresponding
-value. The two-way ANOVA table
corresponding to the test of no interaction is given by
Note that the
-test statistic in the column `Interaction' is exactly the
test statistics from above.
If the hypothesis of no interaction is accepted, the model (12.8)
reduces to the additive model in (12.9), that is,
where the
s are independent normally distributed random
error terms with zero mean and common variance
. Before testing
for significance of the row and column factors, we need to decompose the
total unexplained variation in the data,
, in components
corresponding to the updated model (12.8). That is, we split
into a row factor-part
, a column factor-part
, and a part due to unexplained residual variation
. We get
where
is the unexplained residual variation of the additive model (12.10).
Appropriate test statistics for tests for factor main effects follow the
usual way. We can test for no row factor main effect
by considering the statistic:
The null hypothesis of no row factor main effect is rejected if
is
large. It can be shown
has an
distribution, if
is true. A similar argument leads to the following
test statistic for testing for no column factor main effect
:
The null hypothesis
of no column factor main effect is rejected if
is large. It can be shown
has an
distribution, if
is true.
The two-way ANOVA table for the two above tests is given by
Note that the
-test statistics in the columns `Row' and `Column' are
exactly the test statistics for the tests of no row-factor main effect, and
no column-factor main effect, respectively.
Example 12.1 (continued) Reducing stress
The two-way ANOVA table for the data on stress reducing drugs is given by
Note that the
-value for the test of no interaction is less than 0.05.
That is, we reject the hypotheses
of no interaction at the 5%
significance level. Since interaction exists, we cannot make any general
statements about the effect of one of the factors without taking the level
of the other factor into account. Instead we can compare the four sample
means in the two mean plots in Figures 12.1 and 12.4.
Figure 12.4:
Mean plots for levorphanol and epinephrine
|
|
The figures suggest that the cortical sterone level increases when the
animal is treated with epinephrine; but that the increase in the cortical
sterone level is less when the animal is treated with levorphanol as well as
epinephrine, than when it is treated only with epinephrine. Further, the
cortical sterone level is reduced when the animal receives levorphanol-but
it is reduced more when the treatment includes epinephrine as well, than
when the treatment consists only of levorphanol. The sample means for the
four combinations of factor levels are given in the table below.
It seems that a treatment of levorphanol, but not epinephrine, minimises the
level of cortical sterone. In particular, the control group (i.e. the
group receiving neither drug) has the second-lowest level of cortical
sterone. The only group with a lower level is the group receiving
levorphanol, but not epinephrine.
Note that, since the hypothesis of no interaction is rejected, we cannot
make any general statements about the main effects of levorphanol and
epinephrine, respectively, without taking the level of the other factor into
account. One might wish to continue the analysis using a one-way ANOVA with
four treatment-levels.
Example 12.2 (continued) Different protein diets
The two-way ANOVA table for the data on weight gain of rats on diets of
different protein sources (row factor) and different amounts of protein
(column factor), is given by
Note firstly, that the
-value for the test for no interaction exceeds
0.05, so we accept the null hypothesis of no interaction at the 5%
significance level. We can then consider the tests for no main effects of
the factors. The new two-way ANOVA table is given by
Since the
-value corresponding to the null hypothesis of no row factor
(protein source) main effect is very large, we can remove this factor from
the model. That is, it seems that the source of protein does not influence
the weight gains of the rats significantly, at the 5% level. We end up with
a one-way ANOVA model for the weight gains of these rats:
where
is the overall mean weight gain,
is the effect of
a low-amount diet on the mean weight gain,
is the effect of a
high-amount diet on the mean weight gain, and
accounts
for the unexplained random variation in the data.
In Example 12.2, our final model is a one-way ANOVA model. In such cases,
where there is no interaction and only one of the factor main effects is
significant, the multiway ANOVA model reduces to a one-way ANOVA model. The
analysis of the data can be continued as in Modules 10 and 11. For example,
we could use the pairwise tests from Module 11 to compare the effects of the
different factor levels of the remaining factor.
In this Module, we have used an ANOVA-approach (see Module 10) to analyse
factorial experiments. Alternatively, one could use a regression-approach
(see Module 10). We shall do this in Module 13.
We have analysed data from factorial experiments. In factorial experiments
we are interested in the effect of two or more factors on a response
variable. In this module, we have only considered situations where all
factors are fixed. Also, we have required that the number of observations is
the same for each cell (that is, for each sub-sample corresponding to the
different combinations of levels of the factors.)
In the analysis of a factorial experiment, we investigate the main effects
of each of the factors and the interactions between the factors. In a
two-factor experiment, a mean plot can provide a visual indication of
whether or not the two factors interact. In order to conduct formal tests
for hypotheses of no interaction, and hypotheses of no factor main effect
(for each factor), we use a multiway ANOVA. Note that if the hypothesis of
no interaction between two factors is rejected, that is, if interaction
exists, then the two hypotheses of no factor main effects are irrelevant,
since both factors clearly do affect the response variable through the
interaction effect. In a multiway ANOVA, if there is no interaction, and if
only one of the factor main effects is significant, the multiway ANOVA model reduces to a one-way ANOVA model. The data analysis can be continued
with a one-way ANOVA.
Keywords: factorial experiments, fixed-effects models, balanced
experiment, main effect, second-order interaction, third-order interaction,
mean plot, row factor, column factor, two-way ANOVA model, three-way ANOVA
model, multiway ANOVA model, two-way ANOVA, test for no interaction,
additive model, test for no row factor main effect, test for no column
factor main effect.
|
 |