Lab 7
Work on manipulating tables and carrying out tests (sections 2.1-2.5, 3.1-3.5 only).
Before starting, you will need to load the vcd and vcdExtra packages
using the R function library().
Before starting, you will need to load the vcd and vcdExtra packages
using the R function library().
NOTE: The web address for the article by Richard Darlington (section 3.5) incorrect.
Explore making mosaic plots
## Example R code for Arthritis mosaic plot:
data("Arthritis", package = "vcd")
(art <- xtabs(~ Treatment + Improved, data = Arthritis, subset = Sex == "Female")) ## females only
set.seed(1071)
library(vcd)
mosaic(art, gp = shading_max, gp_args = list(n = 5000), split_vertical=TRUE)
## OR: mosaicplot(art)
Click lab07-vcd-tutorial.pdf link to view the file.