research label grad course label undergrad course label other labelbook linkarticles linkworking paper linkAdvanced Quantitative Political Methodology
	        linkmax likelihood linkvisualizing data linkpanel data linkPolitical Science as Social Science
	       LinkIntro to Soc Stat linkCase-Based Stat linkPolitical Economy Seminar linkSoftware linkData

Visualizing Data and Models

CSSS 569

Good visual displays uncover patterns quantitative scientists might otherwise miss, and can make or break a paper. This course takes the design of graphics and tables seriously, and surveys a variety of visual techniques for exploring data and summarizing statistical models. Emphasis on principles of effective visualization, novel visual displays, examples from the social sciences, and implementation of recommended techniques in R.

CSSS 569

Visualizing Data and Models

Offered every Winter at the
University of Washington



Winter 2022

Class meets:
TTh 4:30-5:50 pm
Week 1 by Zoom
Week 2+ in Gould 322


Ramses Llobet
(UW Political Science)

Section meets:
F 10:30 am–12:20 pm
F 3:30 pm–5:20 pm
Taught by Zoom

Lectures           Click on lecture titles to view slides or the buttons to download them as PDFs.

Short Course

Visualizing Model Inference and Robustness  

This is a 9-hour short course version of the full Data Visualization course; the lectures for the full term course are below. Students taking the short course will also need these additional resources:

Topic 1

Course Introduction  

Topic 2

Principles for the Visual Display of Scientific Information  

Topic 3

Cognitive Issues in Visualization  

Topic 4

Graphical Programming in R  

In the first part of the lecture, we will consider examples from ggplot2 collected in this R script, which relies on this dataset.

In the second half of the lecture, time permitting, we will work through an R script that uses grid graphics to solve a basic task, showing confidence intervals around a regression line using this dataset. Finally, a more advanced grid graphics script replaces ticks with gridlines and packs the grid graphics code inside a more general and usable function, contained in this required helper file. The final graphic can be viewed here.

Interested students can find detailed instructions for downloading, installing, and learning my recommended software for quantitative social science here. Focus on steps 1.1 and 1.3 for now, and then, optionally, step 1.2. (Note: These recommendations may seem dated, as many students prefer to use RStudio as an integrated design environment in combination with RMarkdown. You are free to follow that model, which minimizes start-up costs. I still prefer a combination of Emacs, the plain R console, and Latex/XeLatex for my own productivity, with occasional use of Adobe Illustrator for graphics touch-up.)

Topic 5

Exploratory Data Analysis: Between Data & Model    

Topic 6

Visualizing Inference  

Download instructions for the tile package can be found under the Software tab at left. We will discuss up to four examples in detail:

Topic 7

Interactive Visual Displays with R + Shiny

The Shiny package makes it easy to convert your R code and graphics, including those made with the tile package, into interactive displays for the web. We’ll work through the written Shiny tutorial at the bottom of this page.

We will discuss several Shiny interactives written by your instructor. Feel free to study the applications and code and come to class with questions:

Topic 8

Advanced Latex for Scientific Typesetting

Time permitting, we will consider the use of modern Latex typesetting tools, especially Xetex and the fontspec package. I offer three stylesheets for students looking to spruce up their documents. (Students new to Latex should read the Not So Short Introduction to Latex before embarking on any of the advanced stylesheets below.)

  • caxetexFreeOL (manual). A powerful XeLaTeX stylesheet using free typefaces and implemented for the popular, easy-to-use Latex platform Overleaf. You can find everything you need to get started with caxetexFreeOL at this Overleaf project. Note in particular the template for research papers.
  • caxetexFree (manual). The same powerful XeLaTeX stylesheet using free typefaces, but for use on your local computer's TeX installation. You will need to download the relevant typefaces as instructed in the manual.
  • caxetexBook (manual). The main XeLaTeX stylesheet I use in my own publishing. You will need to purchase the commercial typefaces listed in the manual if you wish to use this stylesheet.

Gallery 1

Scales and Storytelling  

Gallery 2

Maps as Visual Displays of Information  

Gallery 3

Time Series as Narrative  

See also this excellent confection from XKCD explaining the scale of global temperature variation over the last 20,000 years.

Gallery 4

Grayscale Images of Continuous Data  

Gallery 5

Turning Tables into Graphs  

Gallery 6

Heatmaps for Visualizing Continuous Dyadic Data    

Gallery 7

Ternary Plots for Compositional Data Analysis  

Student Assignments

Problem Set 1  

Due by 27 January 2022; turn in problem 2 early if possible

You will need these data.

Problem Set 2  

Due in class 15 February 2022

Problem Set 3  

Due 16 March 2022

Breakout Group

Individual memo due before group meets; Group essay due by 21 February

Students will join a small group to discuss a visual display problem of common interest; creation and organization of these groups to be coordinated through the web. Students will write a 2-5 page memo before the first group meeting, and each group will write a 5-8+ page essay for the class on what they have learned, to be distributed by 21 February. Groups will answer questions from the class during the week of 21 February. See the syllabus for further details.

Final Poster

Presented during the final three to four classes

On an assigned day during the last two weeks of the course, each poster group will present a poster applying the tools learned in class to their own research. Alternatively, students can take an article published in their field and show how better visuals would either more clearly convey the findings or cast doubt on them. The final presentation may address problems raised in the breakout session or problem sets, but it is usually more fruitful for students to tackle a new problem.


Lab 1

Intro to labs, R and RMarkdown  

Supplementary material: Take a look at the section syllabus. For a crash course in base R and tidyverse, see supplementary slides (also, the source .Rmd; two datasets for practice and knitting the file are the two .csv files from below.

First, we will review this R script file. For RMarkdown, see lab_1.Rmd (and the sample PDF output). You will need to use these two datasets: econ.csv and pop.csv. Furthermore, the R Markdown file has an image embedded. Or you can just download all the materials in the following .ZIP file.

Lab 2

Intro to LaTeX with Overleaf  

Supplementary material: Source .Rmd for section slides.

A sample output for kickstarting homework 1 with its source .Rmd; two figures needed to knit the .Rmd: here and here. Or you can just download all the materials in the following .RAR compressed file.

Lab 3

Intro to ggplot2  

Supplementary material: Source .Rmd for section slides; seven figures needed to knit the .Rmd: here,here,here, here,here,here, and here.

An html file with all the code that we will review during the lab, jointly with its source .Rmd. Or you can just download all the materials in the following .RAR compressed file.

Lab 4

Advanced ggplot2  

Supplementary material: Source .Rmd for section slides; you will need the following figures to knit the .Rmd: here,here,here, here, and here

The slides for homework 1:b replication with the source lab_1.Rmd and the R script with all the code for replicate all the visuals of this lab. You will need the following datasets: here,here,here, and presVoteEV. Or you can just download all the materials in the following .RAR compressed file.

Lab 5

Intro to tile  

Supplementary material: You can download all the materials in the following .RAR file. Notice that you will need to install tile and simcf to run the code.

In today's lab we will work with Chris' examples on Homework 1b, the Lineplots voting and if time permits the Ropeleadder.

Lab 6

Visualizing spatial data  

Supplementary material: You can download all the lab materials here.

Lab 7

Visualizing network/relational data  

Supplementary material: You can download all the lab materials here.

Lab 8

Intro to Interactive Visual Display with R + Shiny  

Supplementary material: You can download all the lab materials here.

Lab 9

ggplot2 extension packages for visualization  

Supplementary material: The underlying .Rmd written with flipbookr + xaringan packages.

University of Washington link

CSSS Center for Statistics and the Social Sciences link

Designed by
Chris Adolph & Erika Steiskal

Copyright 2011–2022
Privacy · Terms of Use

Jefferson (2007-2011)