emm | R Documentation |
multcomp::glht
These functions and methods provide an interface between emmeans and
the multcomp::glht
function for simultaneous inference provided
by the multcomp package.
emm(...)
as.glht(object, ...)
## S3 method for class 'emmGrid'
as.glht(object, ...)
... |
In |
object |
An object of class |
emm
returns an object of an intermediate class for which
there is a multcomp::glht
method.
as.glht
returns an object of class glht
or glht_list
according to whether object
is of class emmGrid
or emm_list
.
See Details below for more on glht_list
s.
emm
emm
is meant to be called only from "glht"
as its second
(linfct
) argument. It works similarly to multcomp::mcp
,
except with specs
(and optionally by
and contr
arguments) provided as in a call to emmeans
.
If the specifications in ...
would result in a list (i.e., an
emm_list
object), then by default, only the last element of that list
is passed to glht
. However, if ...
contains a which
argument consisting of integer values, the list elements with those indexes
are selected and combined and passed on to glht
. No checking is done
on whether the indexes are valid, and the keyword which
must be spelled-out.
as.glht
When no by
variable is in force, we obtain a glht
object; otherwise
it is a glht_list
. The latter is defined in emmeans, not multcomp,
and is simply a list
of glht
objects.
Appropriate convenience methods coef
,
confint
, plot
, summary
, and vcov
are provided,
which simply apply the corresponding glht
methods to each member.
The multivariate-t
routines used by glht
require that all
estimates in the family have the same integer degrees of freedom. In cases
where that is not true, a message is displayed that shows what df is used.
The user may override this via the df
argument.
if(require(multcomp, quietly = TRUE))
emm_example("glht-multcomp")
# Use emm_example("glht-multcomp", list = TRUE) # to see just the code
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.