### View orthogonal polynomials for 4 levels
poly.lsmc(1:4)
### Setting up a custom contrast function
helmert.lsmc <- function(levs, ...) {
M <- as.data.frame(contr.helmert(levs))
names(M) <- paste(levs[-1],"vs earlier")
attr(M, "desc") <- "Helmert contrasts"
M
}
lsmeans(Oats.lme, helmert ~ Variety)
Run the code above in your browser using DataLab