# NOT RUN {
require(lsmeans)
feedlot.lm <- lm(swt ~ ewt + herd*diet, data = feedlot)
# Obtain LS~means with a separate reference value of ewt for each
# herd. This reproduces the last part of Table 2 in the reference
lsmeans(feedlot.lm, ~ diet | herd, cov.reduce = ewt ~ herd)
# }
Run the code above in your browser using DataLab