cld.emmGrid | R Documentation |
A method for multcomp::cld()
is provided for users desiring to produce
compact-letter displays (CLDs).
This method uses the Piepho (2004) algorithm (as implemented in the
multcompView package) to generate a compact letter display of all
pairwise comparisons of estimated marginal means. The function obtains (possibly
adjusted) P values for all pairwise comparisons of means, using the
contrast
function with method = "pairwise"
. When a P
value exceeds alpha
, then the two means have at least one letter in
common.
## S3 method for class 'emmGrid'
cld(object, details = FALSE, sort = TRUE, by,
alpha = 0.05, Letters = c("1234567890", LETTERS, letters),
reversed = decreasing, decreasing = FALSE, signif.sets = FALSE,
delta = 0, ...)
## S3 method for class 'emm_list'
cld(object, ..., which = 1)
object |
An object of class |
details |
Logical value determining whether detailed information on tests of pairwise comparisons is displayed |
sort |
Logical value determining whether the EMMs are sorted before the comparisons
are produced. When |
by |
Character value giving the name or names of variables by which separate
families of comparisons are tested. If NULL, all means are compared.
If missing, the object's |
alpha |
Numeric value giving the significance level for the comparisons |
Letters |
Character vector of letters to use in the display. Any strings of length greater than 1 are expanded into individual characters |
reversed , decreasing |
Logical value (passed to |
signif.sets |
Logical value. If |
delta |
Numeric value passed to |
... |
Arguments passed to |
which |
Which element of the |
A summary_emm
object showing the estimated marginal means
plus an additional column labeled .group
(when signif.sets = FALSE
),
.signif.set
(when signif.sets = TRUE
), or .equiv.set
(when delta > 0
).
We warn that the default display encourages a poor
practice in interpreting significance tests. Such CLDs are misleading because they
visually group means with comparisons P > alpha
as though they
are equal, when in fact we have only failed to prove that they differ.
A better alternative if one wants to show groupings is to specify an equivalence
threshold delta
; then groupings will be based on actual findings of
equivalence. Another way to display actual findings is to set
signif.sets = TRUE
, so that estimates in the same group are those
found to be statistically different. Obviously, these different options
require different interpretations of the results; the annotations and the label
given the final column help guide how to assess the results.
As further alternatives, consider pwpp
(graphical display of P
values) or pwpm
(matrix display).
Piepho, Hans-Peter (2004) An algorithm for a letter-based representation of all pairwise comparisons, Journal of Computational and Graphical Statistics, 13(2), 456-466.
if(requireNamespace("multcomp"))
emm_example("cld-multcomp")
# Use emm_example("cld-multcomp", list = TRUE) # to just list the code
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.