2^2 Factorial Designs

Two factors each with two levels.

Kris Sankaran true
10-26-2021

Readings 6.1, Rmarkdown

  1. A special case of general factorial design is the \(2^K\) design. This arises when there are \(K\) factors, but only 2 levels for each factor. We assume \(n\) samples at each configuration of factor levels. With only two levels for each factor, these experiments aren’t useful for teasing out subtle variations across levels of a factor. However they are useful for determining which of a large number of factors might be worth investigating further (factor screening).

  1. The simplest case of a \(2^K\) design is when the number of factors \(K = 2\). The experimental design can be represented by corners of a square.

Notation

  1. It will be handy to define ways of indexing corners of the square. One approach is to write + or - for whether we are at a low or high level for that factor. Alternatively, we can represent the corner by all the letters that are at high levels.
A B label
- - (1)
+ - a
- + b
+ + ab
  1. We abuse notation and write \(a\) to represent the total of the response values at the corner +-, rather than just the index of that corner.

Estimating effects

  1. Since there are only two levels for each factor, there are transparent formulas for estimating main and interaction effects.
    • The main effect for A summaries the average change in the response when A is activated. It is defined as \[\begin{align} A &= \frac{1}{2n}\left(\left(ab +a\right) - \left(b + (1)\right)\right) \end{align}\] which is the average of the responses on the edge where A is active minus the average when A is inactive. The definition for B is analogous.
    • The interaction effect measures the degree to which the effect of A changes depending on whether or not B is active. It is defined as \[\begin{align} AB &= \frac{1}{2n}\left[\left(ab - b\right) - \left(a - \left(1\right)\right)\right] \end{align}\] Notice that the role of A and B is symmetric — we could read the interaction as how the effect of B changes depending on whether A is active.

  1. All these effect estimates can be summarized by our tabular notation,
label effect A effect B effect AB
(1) - - +
a + - -
b - + -
ab + + +

Code Example

  1. This code example shows how a plot can help detect an interaction effect. We read in a dataset on agricultural yield when varying two factors, A and B.
library(readr)
library(dplyr)
yield <- read_table2("https://uwmadison.box.com/shared/static/bfwd6us8xsii4uelzftg1azu2f7z77mk.txt")
  1. We can either use facet_wrap in ggplot to split a plot of the data into separate panels or use the base R interaction.plot function. Both plots show how the effect of factor A varies as the value of factor B changes. In this case, the effect of factor A is slightly smaller (lower slope) when factor B isB inactive. In the next lecture though, we’ll see that this difference is not significant (it could very well happen by change under the model with no interaction term).
ggplot(yield) +
  geom_point(aes(A, Yield)) +
  facet_wrap(~B)
interaction.plot(yield$A, yield$B, yield$Yield)