A short description of the post.
How can we generalize the \(2^2\) analysis so that we can do studies that inspect many factors simultaneously (all at two levels each)? For now, we’ll analyze the 3 factor case (the \(2^3\) design), but with an eye out for more general patterns
For the \(2^3\) design, we have 8 factor configurations
facet_grid
to see effects across all 8 configurations.library(readr)
library(dplyr)
plasma <- read.table("https://uwmadison.box.com/shared/static/f3sggiltyl5ycw1gu1vq7uv7omp4pjdg.txt", header = TRUE)
ggplot(plasma) +
geom_point(aes(A, Rate)) +
facet_grid(B ~ C)
A | B | C | label |
---|---|---|---|
- | - | - | (1) |
+ | - | - | a |
- | + | - | b |
- | - | + | c |
+ | + | - | ab |
+ | - | + | ac |
- | + | + | bc |
+ | + | + | abc |
The main effect estimates can be made by subtracting the + from the - corners. Equivalently, this can be viewed as the difference in averages,
For example, to estimate the main effect of \(A\), we can use, \[A = \frac{1}{2^3 n}\left[\left(a + ab + ac + abc\right) - \left(\left(1\right) + b + c + bc\right)\right]\]
To estimate interactions, we compare how the average effects of a variable change when we condition on the value of another variable. For example, for the interaction \(AB\), notice that
B | Average A Effect |
---|---|
+ | \(\frac{1}{2^3 n}\left[\left(abc - bc\right) + \left(ab - b\right)\right]\) |
- | \(\frac{1}{2^3 n}\left[\left(ac - c\right) + \left(a - \left(1\right)\right)\right]\) |
which inspires the definition,
\[ AB = \frac{1}{2^3 n}\left[abc - bc + ab - b - ac + c - a + \left(1\right)\right] \]
A | B | C | AB | label |
---|---|---|---|---|
- | - | - | + | (1) |
+ | - | - | - | a |
- | + | - | - | b |
- | - | + | + | c |
+ | + | - | + | ab |
+ | - | + | - | ac |
- | + | + | - | bc |
+ | + | + | + | abc |
We won’t prove why this works, but you can use it as a device for avoiding having to memorize everything. The three-way interaction is defined as the change in two-way interactions across the two values for the third variable. It’s contrast can be derived also by multiplying the relevant columns from the table above.