# NOT RUN {
warp.lm <- lm(breaks ~ wool * tension, data = warpbreaks)
warp.emmGrid <- emmeans(warp.lm, ~ tension | wool)
warp.emmGrid # implicitly runs 'summary'
confint(warp.emmGrid, by = NULL, level = .90)
# --------------------------------------------------------------
pigs.lm <- lm(log(conc) ~ source + factor(percent), data = pigs)
pigs.emmGrid <- emmeans(pigs.lm, "percent", type = "response")
summary(pigs.emmGrid) # (inherits type = "response")
# For which percents is EMM non-inferior to 35, based on a 10% threshold?
# Note the test is done on the log scale even though we have type = "response"
test(pigs.emmGrid, null = log(35), delta = log(1.10), side = ">")
test(contrast(pigs.emmGrid, "consec"))
test(contrast(pigs.emmGrid, "consec"), joint = TRUE)
# }
Run the code above in your browser using DataLab