d <- as_hce(KHCE)
res <- calcWO(AVAL ~ TRTP, data = d)
plot(d, col = 2, type = 'l', ylab = "Active", xlab = "Control", lwd = 2)
polygon(c(0, 1, 1, 0), c(1, 1, 1, 0), col = 2)
legend("bottomright", legend = paste0("WP = ", round(res$WP, 5)))
Run the code above in your browser using DataLab