# Example 1: Using pairwise.htest (Wilcoxon test)
obj1 <- stats::pairwise.wilcox.test(chickwts$weight, chickwts$feed, exact = FALSE)
cld::make_cld(obj1)
# Example 2: Using pairwise.htest (t-test)
obj2 <- with(OrchardSprays, stats::pairwise.t.test(decrease, treatment))
cld::make_cld(obj2)
# Example 3: Using pairwise.htest (proportion test)
# \donttest{
smokers <- c(83, 90, 129, 70)
patients <- c(86, 93, 136, 82)
obj3 <- stats::pairwise.prop.test(smokers, patients)
cld::make_cld(obj3)
# }
# Example 4: Using PMCMR objects
# \donttest{
obj4 <- PMCMRplus::kwAllPairsConoverTest(count ~ spray, data = InsectSprays)
cld::make_cld(obj4)
# }
# Example 5: Using DescTools objects
# \donttest{
obj5 <- DescTools::ConoverTest(weight ~ group, data = PlantGrowth)
cld::make_cld(obj5)
# }
# Example 6: Using rstatix data frames (via data.frame method)
# \donttest{
obj6 <- rstatix::games_howell_test(PlantGrowth, weight ~ group)
cld::make_cld(obj6, gr1_col = "group1", gr2_col = "group2", p_val_col = "p.adj")
# }
# Example 7: Using formula interface
my_dataframe <- utils::read.table(
text = c(
'Comparison p_value p.adjust
"EE - GB = 0" 1 1.000000
"EE - CY = 0" 0.001093 0.003279
"GB - CY = 0" 0.005477 0.008216'
),
header = TRUE
)
cld::make_cld(p.adjust ~ Comparison, data = my_dataframe)
# Example 8: Using a symmetric matrix of p-values
# Create matrix
m <- c(
1.00, 0.22, 0.05, 0.00,
0.22, 1.00, 0.17, 0.01,
0.05, 0.17, 1.00, 0.22,
0.00, 0.01, 0.22, 1.00
)
obj8 <- matrix(m, nrow = 4)
rownames(obj8) <- colnames(obj8) <- c("P", "O", "I", "U")
obj8
# Make CLD
cld::make_cld(obj8)
# Example 9: Using data.frame method with custom column names
my_data <- data.frame(
group1 = c("A", "A", "B"),
group2 = c("B", "C", "C"),
p.adj = c(0.001, 0.045, 0.892)
)
cld::make_cld(my_data, gr1_col = "group1", gr2_col = "group2", p_val_col = "p.adj")
Run the code above in your browser using DataLab