Learn R Programming

hce (version 0.7.0)

plot.hce: A plot method for hce objects

Description

Ordinal dominance graph for hce objects

Usage

# S3 method for hce
plot(x, fill = FALSE, ...)

Value

no return value, called for plotting.

Arguments

x

an object of class hce created by as_hce().

fill

logical; if TRUE fill the area above the graph.

...

additional arguments to be passed to base::plot() function.

References

Bamber D. "The area above the ordinal dominance graph and the area below the receiver operating characteristic graph." Journal of Mathematical Psychology 12.4 (1975): 387-415. doi:10.1016/0022-2496(75)90001-2

Examples

Run this code
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