mmc
MMC (Mean--mean Multiple Comparisons) plots.
Constructs a "mmc.multicomp"
object from the formula and
other arguments. The constructed object must be explicitly plotted
with the mmcplot
function.
Usage
mmc(model, ...) ## R# S3 method for glht
mmc(model, ...)
# S3 method for default
mmc(model, ## lm object
linfct=NULL,
focus=
if (is.null(linfct))
{
if (length(model$contrasts)==1) names(model$contrasts)
else stop("focus or linfct must be specified.")
}
else
{
if (is.null(names(linfct)))
stop("focus must be specified.")
else names(linfct)
},
focus.lmat,
ylabel=deparse(terms(model)[[2]]),
lmat=if (missing(focus.lmat)) {
t(linfct)
} else {
lmatContrast(t(none.glht$linfct), focus.lmat)
},
lmat.rows=lmatRows(model, focus),
lmat.scale.abs2=TRUE,
estimate.sign=1,
order.contrasts=TRUE,
level=.95,
calpha=NULL,
alternative = c("two.sided", "less", "greater"),
...
)
multicomp.mmc(x, ## S-Plus
focus=dimnames(attr(x$terms,"factors"))[[2]][1],
comparisons="mca",
lmat,
lmat.rows=lmatRows(x, focus),
lmat.scale.abs2=TRUE,
ry,
plot=TRUE,
crit.point,
iso.name=TRUE,
estimate.sign=1,
x.offset=0,
order.contrasts=TRUE,
main,
main2,
focus.lmat,
...)
# S3 method for mmc.multicomp
[(x, ..., drop = TRUE)
Arguments
- model
"aov"
object in"lm"
method.- ylabel
name of the response variable.
- lmat
contrast matrix as in the S-Plus
multicomp
. The convention forlmat
in R is to use the transpose of thelinfct
component produced byglht
. Required for user-specified contrasts.- lmat.rows
rows in
lmat
for thefocus
factor.- focus
define the factor to compute contrasts of. In R this argument often can be used to simplify the call. The statement
mmc(my.aov, focus="factorA")
is interpreted asmmc(my.aov, factorA="Tukey", `interaction_average`=TRUE, `covariate_average`=TRUE)
WithTRUE, TRUE
,multcomp::glht
always gives the same result as the S-Plusmultcomp
function. Without theTRUE, TRUE
,multcomp::glht
gives a different answer when there are interactions or covariates in the model. See- focus.lmat
R only. Contrast matrix used in the user-specified comparisons of the
focus
factor. This is the matrix the user constructs. Row names must include all levels of the factor. Column names are the names the user assigns to the contrasts. Each column must sum to zero. Seecatalystm.lmat
in the Examples section for an example. Thefocus.lmat
matrix is multiplied by thelmat
from thenone
component to create thelmat
for the user-specified contrasts. Display thehibrido.lmat
andmaiz2.lmat
in the maiz example below to see what is happening.- linfct
In R, see
- …
other arguments.
alternative
andbase
are frequently used withglht
.- comparisons
argument to
multicomp
- lmat.scale.abs2
logical, scale the contrasts in the columns of
lmat
to make the sum of the absolute values of each column equal 2.- estimate.sign
numeric. If
0
, leave contrasts in the default lexicographic direction. If positive, force all contrasts to positive, reversing their names if needed (if contrast A-B is negative, reverse it to B-A). If negative, the force all contrasts to positive.- order.contrasts
sort the contrasts in the (
mca
,none
,lmat
) components by height on the MMC plot. This will place the contrasts in the multicomp plots in the same order as in the MMC plot.- alternative
Direction of alternative hypothesis. See
- level
Confidence level. Defaults to 0.95.
- crit.point, calpha
critical value for the tests. The value from the specified
multicomp
method is used for the user-specified contrasts whenlmat
is specified. This argument is calledcrit.point
withmulticomp
in S-Plus andcalpha
when used withglht
andconfint
in R. In R, with a large number of levels for the focus factor,calpha
should be specified. See notes below for discussion of the timing issues and the examples for an illustration how to usecalpha
.- plot
logical, display the plot if
TRUE
.- ry, iso.name, x.offset, main, main2
arguments to
plot.mmc.multicomp
.- x, drop
See
"["
.
Details
By default, if lmat
is not specified, we plot the isomeans grid
and the pairwise comparisons for the focus
factor. By default,
we plot the specified contrasts if the lmat
is specified.
Each contrast is plotted at a height which is the weighted average of
the means being compared. The weights are scaled to the sum of their
absolute values equals 2.
We get the right contrasts automatically if the aov is oneway. If we specify an lmat for oneway it must have a leading row of 0.
For any more complex design, we must study the lmat
from the mca
component of the result to see how to construct the lmat
(with the
extra rows as needed) and how to specify the lmat.rows
corresponding to the rows for the focus factor.
mmc
in R works from either an "glht"
object or an
"aov"
object. multicomp.mmc
in S-Plus works from an
"aov"
object.
Value
An "mmc.multicomp"
object contains either the first two or all
three of the "multicomp"
components mca
, none
,
lmat
described here. Each "multicomp"
component in
R also contains a "glht"
object.
Object containing the pairwise comparisons.
Object comparing each mean to 0.
Object for the contrasts specified in
the lmat
argument.
"[.mmc.multicomp" is a subscript method.
Note
The multiple comparisons calculations in R and S-Plus use
completely different functions.
MMC plots in R are constructed by mmc
based on
References
Heiberger, Richard M. and Holland, Burt (2004b). Statistical Analysis and Data Display: An Intermediate Course with Examples in S-Plus, R, and SAS. Springer Texts in Statistics. Springer. ISBN 0-387-40270-5.
Heiberger, Richard M. and Holland, Burt (2006). "Mean--mean multiple comparison displays for families of linear contrasts." Journal of Computational and Graphical Statistics, 15:937--955.
Hsu, J. and Peruggia, M. (1994). "Graphical representations of Tukey's multiple comparison method." Journal of Computational and Graphical Statistics, 3:143--161.