# A balanced complete block design: 3 treatments measured on 6 subjects
df <- data.frame(
id = factor(rep(1:6, 3)),
treatment = factor(rep(c("A", "B", "C"), each = 6)),
score = c(4, 6, 3, 5, 4, 5, 7, 8, 6, 7, 9, 6, 6, 9, 7, 8, 8, 9)
)
# Omnibus Friedman test
df %>% friedman_test(score ~ treatment | id)
# Conover (Durbin-Conover) all-pairs post-hoc
df %>% friedman_conover_test(score ~ treatment | id)
# Comparison against a reference (control) treatment
df %>% friedman_conover_test(score ~ treatment | id, ref.group = "A")
Run the code above in your browser using DataLab