
This function presents results from emmeans
and pairwise comparisons
thereof in a compact way. It displays a matrix (or matrices) of estimates,
pairwise differences, and P values. The user may opt to exclude any of these
via arguments means
, diffs
, and pvals
, respectively.
To control the direction of the pairwise differences, use reverse
;
and to control what appears in the upper and lower triangle(s), use flip
.
Optional arguments are passed to contrast.emmGrid
and/or
summary.emmGrid
, making it possible to control what estimates
and tests are displayed.
pwpm(emm, by, reverse = FALSE, pvals = TRUE, means = TRUE,
diffs = TRUE, flip = FALSE, digits, ...)
An emmGrid
object
Character vector of variable(s) in the grid to condition on. These
will create different matrices, one for each level or level-combination.
If missing, by
is set to emm@misc$by.vars
.
Grid factors not in by
are the primary factors:
whose levels or level combinations are compared pairwise.
Logical value passed to pairs.emmGrid
.
Thus, FALSE
specifies "pairwise"
comparisons
(earlier vs. later), and TRUE
specifies "revpairwise"
comparisons (later vs. earlier).
Logical value. If TRUE
, the pairwise differences
of the EMMs are included in each matrix according to flip
.
Logical value. If TRUE
, the estimated marginal means
(EMMs) from emm
are included in the matrix diagonal(s).
Logical value. If TRUE
, the pairwise differences
of the EMMs are included in each matrix according to flip
.
Logical value that determines where P values and differences
are placed. FALSE
places the P values in the upper triangle
and differences in the lower, and TRUE
does just the opposite.
Integer. Number of digits to display. If missing, an optimal number of digits is determined.
Additional arguments passed to contrast.emmGrid
and
summary.emmGrid
. You should not include method
here, because pairwise comparisons are always used.
A matrix or `list` of matrices, one for each `by` level.
A graphical display of essentially the same results is available
from pwpp
# NOT RUN {
warp.lm <- lm(breaks ~ wool * tension, data = warpbreaks)
warp.emm <- emmeans(warp.lm, ~ tension | wool)
pwpm(warp.emm)
# use dot options to specify noninferiority tests
pwpm(warp.emm, by = NULL, side = ">", delta = 5, adjust = "none")
# }
Run the code above in your browser using DataLab