R: Multiple comparisons plot that gives independent user control...
plot.multicomp
R Documentation
Multiple comparisons plot that gives independent user control
over the appearance of the significant and not significant comparisons.
Description
Multiple comparisons plot that gives independent user control
over the appearance of the significant and not significant
comparisons.
In R, both plot.multicompplot.multicomp.hh coerce their argument
to an "glht" object and plots
that with the appropriate plot method.
In R, plot.multicomp.adjusted replaces the bounds
calculated by multcomp:::confint.glht with bounds based on
a common standard error for a set of anova tables that are
partitioned for the simple effects on an analysis conditioned on
the levels of one of the factors.
In S-Plus,
plot.multicomp.hh augments the standard plot.multicomp to
give additional user arguments to control the appearance of the plot.
plotMatchMMC uses the plot.multicomp.hh code.
plotMatchMMC must immediately follow a plot of an
mmc.multicomp object and is applied to either the $mca
or $lmat component of the mmc.multicomp object.
plotMatchMMC is used as a tiebreaker plot for the MMC
plot. plotMatchMMC matches the horizontal scaling of the
MMC plot and displays the individual contrasts in the same
order as the MMC plot. See mmc for examples.
These functions are no longer recommended. Use mmcplot instead.
Usage
## S3 method for class 'multicomp'
plot(x, ...) ## R only
## S3 method for class 'multicomp.hh'
plot(x, ylabel = x$ylabel, href = 0, uniform = TRUE,
plt.in = c(0.2, 0.9, 0.1, 0.9),
x.label.adj=1,
xrange.include=href,
xlim,
comparisons.per.page=21,
col.signif=1, col.not.signif=1,
lty.signif=4, lty.not.signif=4,
lwd.signif=1, lwd.not.signif=1,
...,
xlabel.print=TRUE, y.axis.side=2, ylabel.inside=FALSE)
plotMatchMMC(x, ...,
xlabel.print=FALSE,
cex.axis=par()$cex.axis,
col.signif='red', main="",
ylabel.inside=FALSE,
y.axis.side=4,
adjusted=FALSE)
Arguments
x
A "multicomp" object. plotMatchMMC will also
accept a mmc.multicomp object. It will use the lmat
component if there is one, otherwise it will use the mca component.
ylabel
Y label on graph.
y.axis.side
Y labels are on the left by default when plotting a
"multicomp" object. We move them to the
right when matching the x-axis of an MMC plot.
...
other arguments to plot.multicomp.
ylabel.inside
Logical value, if FALSE (the default), the
plotMatchMMC right-axis labels are in the margin. If
TRUE, the right-axis labels are in the figure area.
Setting the argument to
TRUE makes sense when plotting the lmat component of an
mmc.multicomp object.
href
reference line for the intervals. The default is 0. S-Plus only.
xrange.include
xlim
will be extended to include these values. S-Plus only.
uniform
S-Plus only. Logical value, if TRUE and the plots fill
more than one page, the scale will be uniform across pages.
plt.in
S-Plus only. Value for par("plt") to make better
use of the space on the plotting page.
x.label.adj
S-Plus only. This is the par("adj") applied
to the x-location of the y.labels on the multicomp plot.
xlim
x-range of the plot.
comparisons.per.page
The default S-Plus plot.multicomp
hardwires this to 21, which allows
for all pairwise comparisons of 7 levels taken 2 at a time.
The HH plot.multicomp makes it a variable.
Use it together with plt.in to make better use of the space
on the plot. S-Plus only.
lty.signif, lwd.signif
Line type, and line width for
significant comparisons. S-Plus only.
col.signif
Color for significant comparisons. S-Plus only for
plot.multicomp. Both R and S-Plus for plotMatchMMC.
col.not.signif, lty.not.signif, lwd.not.signif
Color, line
type, and line width for non-significant comparisons. S-Plus only.
xlabel.print
logical. When TRUE, the caption under the
plot is printed. When FALSE, the caption under the plot is not
printed. It is helpful to set this to FALSE when
the multicomp
plot is used as a tiebreaker plot for the MMC plot. S-Plus only.
cex.axis
cex for axis ticklabels.
main
Main title for plot.
adjusted
Logical. When TRUE,
HH:::plot.multicomp.adjusted is used to replace the standard
confidence bounds
calculated by multcomp:::confint.glht, with bounds
calculated by as.multicomp.glht with a rescaled critical
value based on rescaling the standard error. This rescaling is
used to construct a common standard error for a set of anova tables that are
partitioned for the simple effects on an analysis conditioned on
the levels of one of the factors. See the
clover.commonstrMS.clov.mmc example in file hh("scripts/Ch12-tway.r").
Value
plot.multicomp plots a "multicomp" object. In S-Plus, this
masks the standard plot.multicomp in order to provide additional
arguments for controlling the appearance. It defaults to the standard
appearance. In R, it coerces its argument to a "glht" object and plots
that with the appropriate plot method.
Note
The multiple comparisons calculations in R and S-Plus use
completely different packages.
Multiple comparisons in R are based on glht.
Multiple comparisons in S-Plus are based on multicomp.
The MMC plot in the HH package is the same in both systems.
The details of getting the plot differ.
Author(s)
Richard M. Heiberger <rmh@temple.edu>
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, R. M. and Holland, B. (2006).
"Mean–mean multiple comparison displays for families of linear contrasts."
Journal of Computational and Graphical Statistics, 15:937–955.
See Also
mmc in both languages,
glht.
Examples
## data and ANOVA
data(catalystm)
catalystm1.aov <- aov(concent ~ catalyst, data=catalystm)
summary(catalystm1.aov)
catalystm.mca <-
if.R(r=glht(catalystm1.aov, linfct = mcp(catalyst = "Tukey")),
s=multicomp(catalystm1.aov, plot=FALSE))
if.R(s=plot(catalystm.mca),
r=plot(confint(catalystm.mca, calpha=qtukey(.95, 4, 12)/sqrt(2))))
## calpha is strongly recommended in R with a large number of levels
## See ?MMC for details.
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(HH)
Loading required package: lattice
Loading required package: grid
Loading required package: latticeExtra
Loading required package: RColorBrewer
Loading required package: multcomp
Loading required package: mvtnorm
Loading required package: survival
Loading required package: TH.data
Loading required package: MASS
Attaching package: 'TH.data'
The following object is masked from 'package:MASS':
geyser
Loading required package: gridExtra
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/HH/plot.multicomp.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plot.multicomp
> ### Title: Multiple comparisons plot that gives independent user control
> ### over the appearance of the significant and not significant
> ### comparisons.
> ### Aliases: plot.multicomp plot.multicomp.hh plot.multicomp.adjusted
> ### plotMatchMMC
> ### Keywords: dplot
>
> ### ** Examples
>
> ## data and ANOVA
> data(catalystm)
>
> catalystm1.aov <- aov(concent ~ catalyst, data=catalystm)
> summary(catalystm1.aov)
Df Sum Sq Mean Sq F value Pr(>F)
catalyst 3 85.68 28.56 9.916 0.00144 **
Residuals 12 34.56 2.88
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
>
> catalystm.mca <-
+ if.R(r=glht(catalystm1.aov, linfct = mcp(catalyst = "Tukey")),
+ s=multicomp(catalystm1.aov, plot=FALSE))
> if.R(s=plot(catalystm.mca),
+ r=plot(confint(catalystm.mca, calpha=qtukey(.95, 4, 12)/sqrt(2))))
> ## calpha is strongly recommended in R with a large number of levels
> ## See ?MMC for details.
>
>
>
>
>
> dev.off()
null device
1
>