lsmeans (version 2.27-60)

glht: lsmeans support for glht

Description

These functions and methods provide an interface between lsmeans and the glht function for simultaneous inference in the multcomp package.

Usage

# S3 method for ref.grid
as.glht(object, ...)
# S3 method for lsm.list
as.glht(object, ..., which = 1)

# S3 method for glht.list coef(object, ...) # S3 method for glht.list confint(object, ...) # S3 method for glht.list plot(x, ...) # S3 method for glht.list summary(object, ...) # S3 method for glht.list vcov(object, ...)

lsm(...) pmm(...)

Arguments

object, x

An object of the required class.

which

Numeric index of which element of the lsm.list to use.

Additional arguments to other methods.

Value

as.glht returns an object of class glht, or of class glht.list if by is non-NULL. The latter is simply a list of glht objects, and the provided methods coef, confint, plot, summary, and vcov simply lapply the corresponding methods for class "glht".

Details

lsm (and pmm, which is identical) are meant to be called only from "glht" as its second (linfct) argument. It works similarly to mcp except with specs (and optionally by and contr arguments) provided as in a call to lsmeans or pmmeans.

When there is a non-NULL by variable (either explicitly or implicitly), each ``by'' group is passed separately to glht and returned as a list of "glht" objects. For convenience, this is classed as "glht.list", and appropriate methods coef, confint, plot, summary, and vcov are provided.

See Also

lsmeans, glht

Examples

Run this code
# NOT RUN {
require(lsmeans)
require(multcomp)

warp.lm <- lm(breaks ~ wool*tension, data = warpbreaks)

# Using 'lsm'
summary(glht(warp.lm, lsm(pairwise ~ tension | wool)))

# Same, but using an existing 'lsmeans' result
warp.lsmobj <- lsmeans(warp.lm, ~ tension | wool)
summary(as.glht(pairs(warp.lsmobj)))

# Same contrasts, but treat as one family
summary(as.glht(pairs(warp.lsmobj), by = NULL))
# }

Run the code above in your browser using DataLab