PDFPS
Module 12: Factorial experiments
By Pia Veldt Larsen


Table of Contents





12.1 Introduction

Previous Section
Next Section

In Modules 10 and 11, we considered situations where data were collected from $ k$ different populations. Comparisons between the $ k$ 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.




12.2 Factorial experiments

Previous Section
Next Section

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.

$\displaystyle \begin{tabular}{ccc\vert c}
& & \multicolumn{2}{c}{Epinephrine:} ...
...& No & 5.33, 4.84, 5.26, 4.92, 6.07 & 1.90, 1.80, 1.54, 4.10, 1.89\end{tabular}$

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.


$ \diamondsuit$


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.




12.2.1 Main effects and interactions

Previous Section
Next Section

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 $ \mu _{LE}$ the mean cortical sterone level for animals receiving both levorphanol and epinephrine, $ \mu _{Le}$ for animals only receiving levorphanol, $ \mu _{lE}$ for animals receiving only epinephrine, and $ \mu _{le}$ for the control group, receiving neither drug. (Note that the subscripts $ L$ and $ E$ denote presence of levorphanol and epinephrine, respectively, and $ l$ and $ e$ denote absence of the same drugs, respectively.) Then $ \mu _{LE}-\mu
_{lE}$ is a measure of the effect of the drug levorphanol on animals who receive the additional drug epinephrine, and $ \mu _{Le}-\mu _{le}$ is a measure of the effect of levorphanol on animals who do not receive epinephrine. Thus, the contrast

$\displaystyle L_{L}=\left( \left( \mu _{LE}-\mu _{lE}\right) +\left( \mu _{Le}-...
...{le}\right) \right) /2=\left( \mu _{LE}-\mu _{lE}+\mu _{Le}-\mu _{le}\right) /2$ (12.1)

is a measure of the average (or, overall) effect of levorphanol. (Note that $ L_{L}$ is a contrast since $ \sum_{i=1}^{k}c_{i}=0$ .) Likewise, the contrast

$\displaystyle L_{E}=\left( \left( \mu _{LE}-\mu _{Le}\right) +\left( \mu _{lE}-...
...le}\right) \right) /2=\left( \mu _{LE}-\mu _{Le}+\mu _{lE}-\mu
_{le}\right) /2
$

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 $ H_{0}:L_{L}=0$ and $ H_{0}:L_{E}=0$ .


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 $ \mu _{LE}-\mu _{lE}$ and $ \mu _{Le}-\mu _{le}$ are the same. Thus, their difference will be zero, thus

$\displaystyle L_{I}=\left( \mu _{LE}-\mu _{lE}\right) -\left( \mu _{Le}-\mu _{le}\right)
=\mu _{LE}-\mu _{lE}-\mu _{Le}+\mu _{le}
$

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.)

$ \diamondsuit$


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 $ A$ and $ B$ with levels $ k$ and $ l$ , respectively. The main-effect of Factor $ A$ can be expressed as a set of $ k-1$ contrasts $ L_{A_{1}},L_{A_{2}},\ldots ,L_{A_{k-1}}$ , where the contrast $ L_{A_{i}}$ is the difference between the average mean $ \mu _{A_{i}}$ of data with level $ i$ of Factor $ A$ , that is, $ \mu _{A_{i}}=\sum_{j=1}^{l}\mu _{A_{i}B_{j}}/l$ , and the overall average mean $ \mu =\sum_{i=1}^{k}\sum_{j=1}^{l}\mu
_{A_{i}B_{j}}/lk=\sum_{i=1}^{k}\mu _{A_{i}}/k$ . (Here $ \mu _{A_{i}B_{j}}$ denotes the mean of data with level $ i$ of Factor $ A,$ and level $ j$ of Factor $ B$ .) The $ k-1$ contrasts corresponding to the main-effect of Factor $ A$ are given by

$\displaystyle L_{A_{1}}=\mu _{A_{1}}-\mu ,$  $\displaystyle L_{A_{2}}=\mu _{A_{2}}-\mu ,$  $\displaystyle \ldots$     $\displaystyle ,L_{A_{k-1}}=\mu _{A_{k-1}}-\mu .$ (12.2)

If all the contrasts in (12.2) vanish:

$\displaystyle L_{A_{1}}=L_{A_{2}}=\cdots =L_{A_{k-1}}=0,
$

there is no main-effect of Factor $ A$ , since the mean is the same for all levels of the $ A$ -factor, that is,

$\displaystyle \mu _{A_{1}}=\mu _{A_{2}}=\cdots =\mu _{A_{k-1}}=\mu ,$ (12.3)

or, equivalently,

$\displaystyle \mu _{A_{1}}=\mu _{A_{2}}=\cdots =\mu _{A_{k}}=\mu ,
$

since (12.3) implies that

$\displaystyle \mu _{A_{k}}=k\left( \sum_{i=1}^{k}\mu _{A_{i}}/k-\sum_{i=1}^{k-1}\mu
_{A_{i}}/k\right) =k\mu -\sum_{i=1}^{k-1}\mu _{A_{i}}=\mu .
$

The main-effects of Factor $ B$ can be expressed accordingly as $ l-1$ contrasts. There is no main-effect of Factor $ B$ if all the contrasts corresponding to the $ B$ -factor are equal to zero:

$\displaystyle L_{B_{1}}=L_{B_{2}}=\cdots =L_{B_{l-1}}=0.
$


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 $ k=2$ levels). Using the general approach, an appropriate contrast (12.2) is given by

$\displaystyle L$ $\displaystyle =$ $\displaystyle \mu _{l}-\mu$  
  $\displaystyle =$ $\displaystyle \frac{1}{2}\left( \mu _{lE}+\mu _{le}\right) -\frac{1}{4}\left( \mu
_{lE}+\mu _{le}+\mu _{LE}+\mu _{Le}\right)$  
  $\displaystyle =$ $\displaystyle \frac{1}{4}\left( \mu _{LE}+\mu _{Le}-\mu _{lE}-\mu _{le}\right) .$  

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 $ L$ and (12.1) are equivalent.

$ \diamondsuit$


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, $ L_{I}$ 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
\includegraphics[width=0.75\textwidth]{fig/spstressred}
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.


$ \diamondsuit$


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 $ A$ , along $ x$ -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
\includegraphics[width=0.75\textwidth]{fig/interact2}
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.

$\displaystyle \begin{tabular}{clc\vert c}
& & \multicolumn{2}{c}{Amount:} \\
&...
... 70, 61, 82} & \multicolumn{1}{\vert l}{102,
108, 91, 120, 105}\end{tabular}\
$

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
\includegraphics[width=0.75\textwidth]{fig/spprotein}
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.


$ \diamondsuit$




12.2.2 A model for factorial experiments

Previous Section
Next Section

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 $ r$ levels, and the column factor has $ c$ levels. (In Example 12.2, $ r=3$ and $ c=2$ .) Then the two-way ANOVA model is given by

$\displaystyle Y_{ijk}=\mu +\alpha _{i}+\beta _{j}+\gamma _{ij}+\varepsilon _{ijk}$,  $\displaystyle i=1,\ldots ,r$,  $\displaystyle j=1,\ldots ,c$,  $\displaystyle k=1,\ldots ,n,$ (12.4)

where $ \varepsilon _{ijk}$ are independent normally distributed random variables with zero mean and common variance $ \sigma ^{2}$ , and $ n$ 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: $ \mu $ is the overall mean effect, $ \alpha
_{i}=\mu _{i\cdot }-\mu $ corresponds to the effect of the row factor having level $ i$ (here $ \mu _{i\cdot }=\sum_{j=1}^{c}\mu _{ij}/c$ denotes the average mean of data with row-factor level $ i$ , where $ \mu _{ij}$ is the mean of the $ \left( i,j\right) $ th cell), $ \beta _{j}=\mu _{\cdot j}-\mu $ corresponds to the effect of the column factor having level $ j$ (where $ \mu
_{\cdot j}=\sum_{i=1}^{r}\mu _{ij}/r$ denotes the average mean of data with column-factor level $ j$ ), the $ \gamma _{ij}$ s are the interaction effects between the row factor and the column factor, and finally, the $ \varepsilon
_{ijk}$ s are random error terms. There is interaction between the row and column factors if and only if $ \gamma _{ij}\neq 0$ for at least one pair $ i,j.$ If there is no interaction, the model has no row factor main effect if and only if all the $ \alpha _{i}$ s are zero. If there is no interaction, it has no column factor main effect if and only if all the $ \beta _{j}$ s are zero.


Note that, since the $ \alpha _{i}$ s are the deviances between the mean when row factor has level $ i$ and the average mean, the sum of the $ \alpha _{i}$ s is zero:

$\displaystyle \sum_{i=1}^{r}\alpha _{i}=\sum_{i=1}^{r}\left( \mu _{i\cdot }-\mu \right) =\sum_{i=1}^{r}\mu _{i\cdot }-r\mu =r\mu -r\mu =0.$ (12.5)

Likewise, the sum of the $ \beta _{i}$ s zero

$\displaystyle \sum_{j=1}^{c}\beta _{j}=\sum_{j=1}^{c}\left( \mu _{\cdot j}-\mu \right) =0.$ (12.6)

Further, it can be shown that the interaction-terms $ \gamma _{ij}$ satisfy the following

$\displaystyle \sum_{i=1}^{r}\gamma _{ij}=0$ and  $\displaystyle \sum_{j=1}^{c}\gamma _{ij}=0.$ (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 $ A $ , $ B$ and $ C$ with $ a$ , $ b$ , and $ c$ levels, respectively. Then we can use the three-way ANOVA model, given by

$\displaystyle Y_{ijkl}=\mu +\alpha _{i}+\beta _{j}+\gamma _{k}+\left[ \alpha \b...
... \right] _{jk}+\left[ \alpha \beta \gamma \right] _{ijk}+\varepsilon _{ijkl},
$

for $ i=1,\ldots ,a$ , $ j=1,\ldots ,b$ , $ k=1,\ldots ,c$ and $ l=1,\ldots ,n$ . This model has nine terms. Again, $ \mu $ is the overall mean effect, $ \alpha _{i}$ , $ \beta _{j}$ and $ \gamma _{k}$ correspond to the main effects of factors $ A$ , $ B$ and $ C$ , respectively. Further, the bracketed terms denote interactions between the three factors: $ \left[ \alpha \beta \right] _{ij}$ is the interaction between factors $ A$ and $ B$ , $ \left[
\alpha \gamma \right] _{ik}$ is the interaction between factors $ A$ and $ C$ , $ \left[ \beta \gamma \right] _{jk}$ is the interaction between factors $ B$ and $ C$ , and $ \left[ \alpha \beta \gamma \right] _{ijk}$ is the second-order interaction between factors $ A$ , $ B$ and $ C$ . Finally, the $ \varepsilon
_{ijkl}$ s are independent normally distributed random error term with zero mean and variance $ \sigma ^{2}$ .


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.




12.3 Inference in factorial experiments

Previous Section
Next Section

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

$\displaystyle Y_{ijk}=\mu +\alpha _{i}+\beta _{j}+\gamma _{ij}+\varepsilon _{ijk}$,  $\displaystyle i=1,\ldots ,r$,  $\displaystyle j=1,\ldots ,c$,  $\displaystyle k=1,\ldots ,n,$ (12.8)

where $ r$ is the number of levels of the row factor, $ c$ is the number of levels of the column factor, $ n$ is the common sample size, and the s are independent normally distributed random error terms with zero mean and common variance $ \sigma ^{2}$ . 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

$\displaystyle H_{0R}$ $\displaystyle :$ There is no row factor main effect  
$\displaystyle H_{0C}$ $\displaystyle :$ There is no column factor main effect  
$\displaystyle H_{0RC}$ $\displaystyle :$ There is no interaction between the row and column factors.   

Note that, if the row and column factors interact (i.e. if $ H_{0RC}$ is rejected), then the two hypotheses concerning the main effects of the row and column factors (that is, $ H_{0R}$ and $ H_{0C}$ , 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 $ H_{0RC}$ . This null hypothesis can be expressed in terms of the interaction terms $ \gamma _{ij}$ . If there is no interaction, all interaction terms $ \gamma
_{ij}$ must be zero, that is,

$\displaystyle H_{0RC}:\gamma _{ij}=0$ for all $\displaystyle i,j.
$

If $ H_{0RC}$ is accepted, we can continue the analysis by testing significance of the row and column factor main effects. However, if $ H_{0RC}$ 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 $ \alpha $ , we have, for each level $ \alpha _{1},\alpha _{2},\ldots ,\alpha _{r}$ , a one-way ANOVA model with $ c$ levels, corresponding to the levels of the column factor. Each of the $ r$ 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 $ rc$ populations corresponding to the $ rc$ 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 $ H_{0RC}$ is rejected.)


If the hypothesis of no interaction is accepted, the model (12.8) reduces to the additive model

$\displaystyle Y_{ijk}=\mu +\alpha _{i}+\beta _{j}+\varepsilon _{ijk}$,  $\displaystyle i=1,\ldots ,r$,  $\displaystyle j=1,\ldots ,c$,  $\displaystyle k=1,\ldots ,n,$ (12.9)

where the $ \varepsilon _{ijk}$ s are independent normally distributed random error terms with zero mean and common variance $ \sigma ^{2}$ . Here, $ \mu $ corresponds to the overall mean effect, $ \alpha _{i}=\mu _{i\cdot }-\mu $ to the effect of the row factor having level $ i$ , $ \beta _{j}=\mu _{\cdot
j}-\mu $ to the effect of the column factor having level $ j$ and $ \varepsilon _{ijk}$ 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, $ H_{0R}$ , can be expressed in terms of the $ \alpha _{i}$ s. If there is no row factor main effect all the $ \alpha _{i}$ s must be zero, that is

$\displaystyle H_{0R}:\alpha _{1}=\alpha _{2}=\cdots =\alpha _{r}=0.
$

Similarly, the null hypothesis of no column factor main effect, $ H_{0C}$ , can be expressed in terms of the $ \beta _{j}$ s, by

$\displaystyle H_{0C}:\beta _{1}=\beta _{2}=\cdots =\beta _{c}=0.
$


We can test hypotheses such as $ H_{0RC}$ , $ H_{0R}$ and $ H_{0RC}$ 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 $ S_{yy}$ , that is,

$\displaystyle S_{yy}=\sum_{i=1}^{r}\sum_{j=1}^{c}\sum_{k=1}^{n}\left( Y_{ijk}-\overline{Y}\right) ^{2},
$

where $ \overline{Y}=\sum_{i=1}^{r}\sum_{j=1}^{c}\sum_{k=1}^{n}Y_{ijk}/(r\,c\,n)$ is the estimator for the overall mean $ \mu $ . By decomposing $ S_{yy}$ into a row factor-part $ \left( SS_{R}\right) $ , a column factor-part $ \left(
SS_{C}\right) ,$ an interaction-part $ \left( SS_{RC}\right) $ , and a part due to unexplained residual variation $ \left( RSS\right) $ , we get
$\displaystyle \sum_{i=1}^{r}\sum_{j=1}^{c}\sum_{k=1}^{n}\left( Y_{ijk}-\overline{Y}\right)
^{2}$ $\displaystyle =$ $\displaystyle \sum_{i=1}^{r}c\,n\left( \overline{Y}_{i\cdot \cdot }-\overline{Y...
...+\sum_{j=1}^{c}r\,n\left( \overline{Y}_{\cdot j\cdot }-\overline{Y}\right) ^{2}$  
    $\displaystyle +\sum_{i=1}^{r}\sum_{j=1}^{c}n\left( Y_{ij\cdot }-\overline{Y}_{i\cdot
\cdot }-\overline{Y}_{\cdot j\cdot }+\overline{Y}\right) ^{2}$  
    $\displaystyle +\sum_{i=1}^{r}\sum_{k=1}^{n}\sum_{j=1}^{c}\left( Y_{ijk}-Y_{ij\cdot
}\right) ^{2}$  
$\displaystyle S_{yy}$ $\displaystyle =$ $\displaystyle SS_{R}+SS_{C}+SS_{RC}+RSS$  

where $ \overline{Y}_{i\cdot \cdot
}=\sum_{j=1}^{c}\sum_{k=1}^{n}Y_{ijk}/\left( c\,n\right) $ , $ \overline{Y}_{\cdot j\cdot }=\sum_{i=1}^{r}\sum_{k=1}^{n}Y_{ijk}/\left( r\,n\right) $ , and $ Y_{ij\cdot }=\sum_{k=1}^{n}Y_{ijk}$ .


We can construct a test statistic to test for no interaction $ \left( H_{0RC}\right) $ using arguments similar to the arguments we have used in other ANOVA contexts: Start by supposing that $ H_{0RC}$ is false. That is, suppose that there exists at least one interaction term $ \gamma _{ij}$ which is different from zero. Then the interaction-part of the total variation $ SS_{RC}$ should explain a significant amount of the variation in the data, relative to the residual variation. That is, if $ H_{0RC}$ is false, we expect $ SS_{RC}$ to be large relative to $ RSS$ , and thus, the ratio

$\displaystyle F_{RC}=\frac{SS_{RC}/\left( \left( r-1\right) \left( c-1\right) \right) }{RSS/\left( r\,c\,\left( n-1\right) \right) }
$

will be large. The null hypothesis of no interaction $ \left( H_{0RC}\right) $ is rejected for large values of $ F_{RC}$ . It can be shown $ F_{RC}$ has an $ F\left( \left( r-1\right) \left( c-1\right) ,r\,c\,\left( n-1\right) \right)
$ distribution, if $ H_{0RC}$ is true.


The test statistic $ F_{RC}$ 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, $ F$ -statistic and corresponding $ p$ -value. The two-way ANOVA table corresponding to the test of no interaction is given by

$\displaystyle \begin{tabular}{lccccc}
Source & \emph{d.f.} & Sum of squares & M...
...\right)
\right) $\ & & \\
Total & $rcn-1$\ & $S_{yy}$\ & & &
\end{tabular}\
$

Note that the $ F$ -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,

$\displaystyle Y_{ijk}=\mu +\alpha _{i}+\beta _{j}+\varepsilon _{ijk}$,  $\displaystyle i=1,\ldots ,r$,  $\displaystyle j=1,\ldots ,c$,  $\displaystyle k=1,\ldots ,n,$ (12.10)

where the $ \varepsilon _{ijk}$ s are independent normally distributed random error terms with zero mean and common variance $ \sigma ^{2}$ . Before testing for significance of the row and column factors, we need to decompose the total unexplained variation in the data, $ S_{yy}$ , in components corresponding to the updated model (12.8). That is, we split $ S_{yy}$ into a row factor-part $ \left( SS_{R}\right) $ , a column factor-part $ \left( SS_{C}\right) $ , and a part due to unexplained residual variation $ \left( RSS_{\text{add}}\right) $ . We get
$\displaystyle \sum_{i=1}^{r}\sum_{j=1}^{c}\sum_{k=1}^{n}\left( Y_{ijk}-\overline{Y}\right)
^{2}$ $\displaystyle =$ $\displaystyle \sum_{i=1}^{r}c\,n\left( \overline{Y}_{i\cdot \cdot }-\overline{Y...
...+\sum_{j=1}^{c}r\,n\left( \overline{Y}_{\cdot j\cdot }-\overline{Y}\right) ^{2}$  
    $\displaystyle +\sum_{i=1}^{r}\sum_{k=1}^{n}\sum_{j=1}^{c}\left( Y_{ijk}-\overline{Y}_{i\cdot \cdot }-\overline{Y}_{\cdot j\cdot }+\overline{Y}\right) ^{2}$  
$\displaystyle S_{yy}$ $\displaystyle =$ $\displaystyle SS_{R}+SS_{C}+RSS_{\text{add}},$  

where $ RSS_{\text{add}}=\sum_{i=1}^{r}\sum_{k=1}^{n}\sum_{j=1}^{c}\left(
Y_{ijk}-\overline{Y}_{i\cdot \cdot }-\overline{Y}_{\cdot j\cdot }+\overline{Y}\right) ^{2}$ 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 $ \left(
H_{0R}\right) $ by considering the statistic:

$\displaystyle F_{R}=\frac{SS_{R}/\left( r-1\right) }{RSS_{\text{add}}/\left(
nr\,c\,-r-c+1\right) }.
$

The null hypothesis of no row factor main effect is rejected if $ F_{R}$ is large. It can be shown $ F_{R}$ has an $ F\left( r-1,nr\,c\,-r-c+1\right) $ distribution, if $ H_{0R}$ is true. A similar argument leads to the following test statistic for testing for no column factor main effect $ \left(
H_{0C}\right) $ :

$\displaystyle F_{C}=\frac{SS_{C}/\left( c-1\right) }{RSS_{\text{add}}/\left(
nr\,c\,-r-c+1\right) }.
$

The null hypothesis $ H_{0C}$ of no column factor main effect is rejected if $ F_{C}$ is large. It can be shown $ F_{C}$ has an $ F\left(
c-1,nr\,c\,-r-c+1\right) $ distribution, if $ H_{0C}$ is true.


The two-way ANOVA table for the two above tests is given by

$\displaystyle \begin{tabular}{lccccc}
Source & \emph{d.f.} & Sum of squares & M...
...}{nr\,c\,-r-c+1}$\ & & \\
Total & $rcn-1$\ & $S_{yy}$\ & & &
\end{tabular}\
$

Note that the $ F$ -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

$\displaystyle \begin{tabular}{lccccc}
Source & \emph{d.f.} & Sum of squares & M...
...\
Error & 16 & 16.30 & 1.02 & & \\
Total & 19 & 53.88 & & &
\end{tabular}\
$

Note that the $ p$ -value for the test of no interaction is less than 0.05. That is, we reject the hypotheses $ H_{0RC}$ 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
\includegraphics[width=0.75\textwidth]{fig/spstressred2}
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.

$\displaystyle \begin{tabular}{ccc\vert c}
& & \multicolumn{2}{c}{Epinephrine:} ...
...anol: & Yes & 2.572 & 1.754 \\ \cline{3-4}
& No & 5.284 & 2.246\end{tabular}\
$

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.


$ \diamondsuit$


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

$\displaystyle \begin{tabular}{lccccc}
Source & \emph{d.f.} & Sum of squares & M...
...\\
Error & 54 & 11589 & 215 & & \\
Total & 59 & 16199 & & &
\end{tabular}\
$

Note firstly, that the $ p$ -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

$\displaystyle \begin{tabular}{lccccc}
Source & \emph{d.f.} & Sum of squares & M...
...\\
Error & 56 & 12764 & 228 & & \\
Total & 59 & 16199 & & &
\end{tabular}\
$

Since the $ p$ -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:

$\displaystyle Y_{ijk}=\mu +\beta _{j}+\varepsilon _{ijk}$$\displaystyle i=1,2,3$,  $\displaystyle j=1,2$,  $\displaystyle k=1,\ldots ,10,
$

where $ \mu $ is the overall mean weight gain, $ \beta _{1}$ is the effect of a low-amount diet on the mean weight gain, $ \beta _{2}$ is the effect of a high-amount diet on the mean weight gain, and $ \varepsilon _{ijk}$ accounts for the unexplained random variation in the data.

$ \diamondsuit$


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.




12.4 Summary

Previous Section
Next Section

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.


HOME | Back

Last modified February 12, 2008. Webmaster