# A graphical multiple comparison procedure with two primary hypotheses (H1
# and H2) and two secondary hypotheses (H3 and H4)
# See Figure 4 in Bretz et al. (2011).
hypotheses <- c(0.5, 0.5, 0, 0)
delta <- 0.5
transitions <- rbind(
c(0, delta, 1 - delta, 0),
c(delta, 0, 0, 1 - delta),
c(0, 1, 0, 0),
c(1, 0, 0, 0)
)
g <- graph_create(hypotheses, transitions)
p <- c(0.018, 0.01, 0.105, 0.006)
alpha <- 0.025
shortcut_testing <- graph_test_shortcut(g, p, alpha, verbose = TRUE)
# Reject H1, H2, and H4
shortcut_testing$outputs$rejected
# Default order of rejections: H2, H1, H4
shortcut_testing$details$del_seq
# There is another valid sequence of rejection: H2, H4, H1
graph_rejection_orderings(shortcut_testing)$valid_orderings
# Finally, intermediate updated graphs can be obtained by providing the order
# of rejections into `[graph_update()]`
graph_update(g, delete = c(2, 4, 1))
Run the code above in your browser using DataLab