d <- as_hce(KHCE)
d$TRTP <- factor(d$TRTP, levels = c("P", "A"))
res <- calcWO(AVAL ~ TRTP, data = d)
# Ordinal Dominance Graph
plot(d, col = 3, type = 'l')
grid()
# Area above the Ordinal Dominance Graph
plot(d, fill = TRUE, col = "#865A4F", type = 'l',
lwd = 2, xlab = "Control", ylab = "Active")
legend("bottomright", legend = paste0("WP = ", round(res$WP, 5)))
abline(a = 0, b = 1, lwd = 2, lty = 2, col = "#999999")
Run the code above in your browser using DataLab