Mosaics Visualizing Categorical Data with SAS and R Mosaics

Michael Friendly
SCS Short Course: Feb-Mar, 2010, 2011, 2012, 2013
Spring Seminar, Cologne: Mar 16-20, 2009

This document provides resources and my short course notes for Visualizing Categorical Data with SAS and R, offered through

General Resources


Lecture notes and workshop files

The exercises for each workshop are described in VCD Workshop exercises. All SAS data sets are contained in the SAS macro programs and data sets ( archive. R data sets are contained in the various R packages. To save typing, scripts for some of the exercises are linked below. These scripts are also available in a archive. Some of the SAS scripts now require SAS 9.3 for ODS graphics.

Topics & lecture notes sasSAS files RR files knitR
1. Introduction & overview
 1.1 Overview: Categorical data & graphics
 1.2 Discrete distributions
 1.3 Testing association

sexfun-chisq.R [knitR]
2. Two-way and n-way tables
 2.1 2 x 2 tables
 2.2 Two-way tables
 2.3 Observer agreement
 2.4 Correspondence analysis

berk-4fold.R [knitR]
vision-sieve.R [knitR]
msdiag-agree.R [knitR]
mental-ca.R [knitR]
3. Mosaic displays & loglinear models
 3.1 n-way tables: Models & graphs
 3.2 Mosaics software
 3.3 Structured tables
berkeley-glm.R [knitR]
titanic-loglin.R [knitR]
mental-glm.R [knitR]
vision-quasi.R [knitR]
4. Logit models & logistic regression
 4.1 Logit models
 4.2 Logistic regression models
 4.3 Effect plots
 4.4 Influence & diagnostic plots
berkeley-logit.R [knitR]
arthritis-logistic.R [knitR]
cowles-logistic.R [knitR]
Arrests-logistic.R [knitR]
cowles-effect.R [knitR]
Arrests-effects.R [knitR]
berkeley-diag.R [knitR]
arthritis-diag.R [knitR]
5. Polytomous response models
 5.1 Proportional odds models
 5.2 Nested dichotomies
 5.3 Generalized logits
arthritis-propodds.R [knitR]

wlf-nested.R [knitR]
wlf-glogit.R [knitR]

Further reading

The main source for these materials is my book, Visualizing Categorical Data

If you want to learn more about categorical data analysis, there are several books and other resources I recommend:

© 2009 Michael Friendly
<friendly AT yorku DOT ca>