# NOT RUN {
warp.lm <- lm(breaks ~ wool*tension, data = warpbreaks)
warp.emm <- emmeans(warp.lm, ~ tension | wool)
contrast(warp.emm, "poly") # inherits 'by = "wool"' from warp.emm
pairs(warp.emm) # ditto
contrast(warp.emm, "eff", by = NULL) # contrasts of the 6 factor combs
# An interaction contrast for tension:wool
tw.emm <- contrast(warp.emm, interaction = c("poly", "consec"), by = NULL)
tw.emm # see the estimates
coef(tw.emm) # see the contrast coefficients
# }
Run the code above in your browser using DataLab