assocplot(x, col = c("black", "red"), space = 0.3,
main = NULL, xlab = NULL, ylab = NULL)
x
.x
.col
, which defaults to black; otherwise, the box falls below
the baseline and is shaded in the color specified by the second
element of col
, which defaults to red. A more flexible and extensible implementation of association plots
written in the grid graphics system is provided in the function
assoc
in the contributed package https://CRAN.R-project.org/package=vcd
(Meyer, Zeileis and Hornik, 2005).mosaicplot
, chisq.test
.## Aggregate over sex:
x <- margin.table(HairEyeColor, c(1, 2))
x
assocplot(x, main = "Relation between hair and eye color")
Run the code above in your browser using DataLab