# 1. All pairwise contrasts among the six marketing panels of the
# test_market data via the default:
fit <- lm(brand_movement ~ panel, data = test_market)
ci_scheffe(fit)
# 2. A contrast chosen after inspecting the means: the two panels with
# the highest brand movement (5 and 6) against the two with the
# lowest (1 and 2). The Scheffe coverage holds for a contrast picked
# this way, and the interval still excludes zero even though none of
# the pairwise intervals above does.
cmat <- matrix(c(-0.5, -0.5, 0, 0, 0.5, 0.5), nrow = 6,
dimnames = list(levels(test_market$panel),
"panels 5,6 - panels 1,2"))
ci_scheffe(fit, contrasts = cmat)
Run the code above in your browser using DataLab