bluesky315 at gmail.com
2010-Feb-09 15:42 UTC
[R] Interpretation of high order interaction terms.
I have difficulties in interpreting high order interaction terms in high-way ANOVA. According to Introductory Statistics with R by Peter Dalgaard (Section 12.5), "The exact definition of the interaction terms and the interpretation of their associated regression coefficients can be elusive. Some peculiar things happen if an interaction term is present but one or more of the main effects are missing. The full details are probably best revealed through experimentation." However, I do want to understand the full details. I have checked a few books, but I haven't found a book that describes high order interactions in a satisfactory way. Besides learning interactions through experimentation, could somebody let me know if there are any detailed documentation on interactions?
RICHARD M. HEIBERGER
2010-Feb-09 18:29 UTC
[R] Interpretation of high order interaction terms.
## Artificial data with all interactions significant. ## The interaction2wt plot shows all main effects and all pairwise ## interactions. We see in the "Y ~ A|B" panel (or in the ## interaction.plot) that Y goes uphill for levels 1 and 2 of B and ## goes down and then up for level 3 of B. This is the two-way A:B ## interaction. At each level of B, the main effect of A differs. ## From the xyplot, we see that at level 1 of C, Y goes down for level ## 3 of B. At level 2 of C, Y goes down a lot and then up for level 3 ## of B. This is the three-way A:B:C interaction. At each level of C ## the two-way interaction of A and B differs. set.seed(1) require(HH) ## needed for interaction2wt() threeway <- data.frame(matrix(c( 1, 1, 1, 1, 2, 2, 1, 1, 3, 3, 1, 1, 1, 1, 2, 1, 2, 2, 2, 1, 3, 3, 2, 1, 3, 1, 3, 1, 2, 2, 3, 1, 1, 3, 3, 1, 1, 1, 1, 2, 2, 2, 1, 2, 3, 3, 1, 2, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, 3, 1, 3, 2, -4, 2, 3, 2, 1, 3, 3, 2), byrow=TRUE, 18, 4, dimnames=list(1:18,c("Y","A","B","C")))) for (i in 2:4) threeway[[i]] <- factor(threeway[[i]]) threeway <- rbind(threeway, threeway) threeway$Y <- threeway$Y + rnorm(36, s=.5) anova(aov(Y ~ A * B * C, data=threeway)) with(threeway, interaction.plot(A, B, Y)) ## shows just the "Y ~ A|B" panel ## all two-way interactions and main effects interaction2wt(Y ~ A + B + C, data=threeway) ## library(HH) required xyplot(x ~ A | C, groups=B, data=aggregate(threeway[,1], threeway[,-1], mean), type="l", auto.key=list(title="B", space="left", border=TRUE, lines=TRUE, points=FALSE), strip=strip.custom(strip.names=c(TRUE,TRUE)))