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 \href{https://CRAN.R-project.org/package=#1}{\pkg{#1}}vcdvcd
(Meyer, Zeileis and Hornik, 2005).
Friendly, M. (1992), Graphical methods for categorical data. SAS User Group International Conference Proceedings, 17, 190--200. http://www.math.yorku.ca/SCS/sugi/sugi17-paper.html
Meyer, D., Zeileis, A., and Hornik, K. (2005) The strucplot framework: Visualizing multi-way contingency tables with vcd. Report 22, Department of Statistics and Mathematics, Wirtschaftsuniversität Wien, Research Report Series. http://epub.wu.ac.at/dyn/openURL?id=oai:epub.wu-wien.ac.at:epub-wu-01_8a1
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