CLD {emmeans} | R Documentation |
Extract and display information on all pairwise comparisons of least-squares means.
CLD(object, ...) ## S3 method for class 'emmGrid' CLD(object, details = FALSE, sort = TRUE, by, alpha = 0.05, Letters = c("1234567890", LETTERS, letters), reversed = FALSE, ...) ## S3 method for class 'emmGrid' cld(object, ...)
object |
An object of class |
... |
Arguments passed to This function uses the Piepho (2004) algorithm (as implemented in the
multcompView package) to generate a compact letter display of all
pairwise comparisons of least-squares means. The function obtains (possibly
adjusted) P values for all pairwise comparisons of means, using the
|
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 |
Logical value (passed to |
When details == FALSE, an object of class summary.ref_grid
(which inherits from data.frame
) showing the summary of EMMs with
an added column named .groups
containing the CLD
information.
When details == TRUE
, a list
with the object just described,
as well as the summary of the contrast results showing each comparison,
its estimate, standard error, t ratio, and adjusted P value.
Hans-Peter Piepho (2004) An algorithm for a letter-based representation of all pairwise comparisons, Journal of Computational and Graphical Statistics, 13(2), 456-466.
cld
in the multcomp package, for which a courtesy
method is provided for emmGrid
objects.
warp.lm <- lm(breaks ~ wool * tension, data = warpbreaks) warp.emm <- emmeans(warp.lm, ~ tension | wool) CLD(warp.emm) # implicitly uses by = "wool" CLD(warp.emm, by = "tension") # overrides implicit 'by' # Mimic grouping bars and compare all 6 means CLD(warp.emm, by = NULL, Letters = "||||||||", alpha = .01)