library(tidyverse)
library(ggpubr)
df <- tibble(
iq = rnorm(150, 100, 15),
condition = rep(c("A", "B"), each = 75),
time = rep(c("t1", "t2", "t3","t1", "t2","t3"), each = 25)
)
ggbarplot(df,
x = "condition",
y = "iq",
fill = "time",
palette = "grey",
add = "mean_se", add.params = list(group = "time"),
position = position_dodge(0.8)) +
stat_compare_means(aes(group = time),label = "p.signif", paired = TRUE,
comparisons = list(c("t1", "t2"),
c("t1", "t3"),
c("t2", "t3")))
![2 x 3 interaction bar plot](https://i.stack.imgur.com/NElZX.jpg)
stat_compare_means()
не удалось провести парное сравнение отдельно для каждой категории.