cldList | R Documentation |
Produces a compact letter display (cld) from pairwise comparisons that were summarized in a table of comparisons
cldList(
formula = NULL,
data = NULL,
comparison = NULL,
p.value = NULL,
threshold = 0.05,
print.comp = FALSE,
remove.space = TRUE,
remove.equal = TRUE,
remove.zero = TRUE,
swap.colon = TRUE,
swap.vs = FALSE,
...
)
formula |
A formula indicating the variable holding p-values and the variable holding the comparisons. e.g. P.adj ~ Comparison. |
data |
The data frame to use. |
comparison |
A vector of text describing comparisons, with each element in a form similar to "Treat.A - Treat.B = 0". Spaces and "=" and "0" are removed by default |
p.value |
A vector of p-values corresponding to the comparisons
in the |
threshold |
The alpha value. That is, the p-value below which the comparison will be considered significant |
print.comp |
If |
remove.space |
If |
remove.equal |
If |
remove.zero |
If |
swap.colon |
If |
swap.vs |
If |
... |
Additional arguments passed to
|
The input should include either formula
and data
;
or comparison
and p.value
.
This function relies upon the multcompLetters
function in the multcompView
package. The text for the
comparisons
passed to multcompLetters
should be in the form
"Treat.A-Treat.B". Currently by default cldList
removes
spaces, equal signs, and zeros, by default,
and so can use
text in the form e.g.
"Treat.A - Treat.B = 0".
It also changes ":" to "-", and so can use
text in the form e.g.
"Treat.A : Treat.B".
A data frame of group names, group separation letters, and monospaced separtions letters
The parsing of the formula is simplistic. The first variable on the left side is used as the measurement variable. The first variable on the right side is used for the grouping variable.
It is often helpful to reorder the factor levels in the data set so that the group with the largest e.g. mean or median is first, and so on.
Salvatore Mangiafico, mangiafico@njaes.rutgers.edu
https://rcompanion.org/handbook/G_06.html
fullPTable
data(BrendonSmall)
model = aov(Calories ~ Instructor, data=BrendonSmall)
TUK = TukeyHSD(model, "Instructor", ordered = TRUE)
### Convert the TukeyHSD output to a standard data frame
TUK = as.data.frame(TUK$Instructor)
names(TUK) = gsub(" ", ".", names(TUK))
HSD = data.frame(Comparison=row.names(TUK),
diff=TUK$diff, lwr=TUK$lwr, lwr=TUK$lwr, p.adj=TUK$p.adj)
HSD
cldList(p.adj ~ Comparison, data = HSD,
threshold = 0.05,
remove.space=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.