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().
NOTE: The web address for the article by Richard Darlington (section 3.5) is:
http://node101.psych.cornell.edu/Darlington/crosstab/TABLE0.HTM
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 on Lab 7 to open the resource.