Applied biostatistics
MATH-493
Lab 7
This page is part of the content downloaded from Lab 7 on Monday, 30 June 2025, 13:46. Note that some content and any files larger than 50 MB are not downloaded.
Description
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)