Data Visualization

Methodology Center Workshop Series · Purdue University · November 2026

The notes for the workshop, with the Stata and R code and output for every example. This site contains all the material and code for the workshop. If you prefer the slides in PDF format and/or the replication files, these can be downloaded at: slides · Stata do-file · R script.

The Methodology Center at Purdue University logo.

Principles of good data visualization

Setup

Install the packages the examples use (once), and set the graphics scheme:

net install cleanplots, from("https://tdmize.github.io/data") replace
ssc install coefplot, replace
ssc install combomarginsplot, replace
ssc install binscatter, replace
ssc install estout, replace

// cleanplots: https://www.trentonmize.com/software/cleanplots
set scheme cleanplots
install.packages(c("foreign", "ggplot2", "dplyr", "marginaleffects",
  "modelsummary", "Hmisc", "remotes"))
library(remotes)                      # installs packages from GitHub
install_github("tdmize/cleanplots")   # Mize's graphics scheme

Each page starts by loading the packages it uses and setting the cleanplots theme:

library(cleanplots)         # Mize's graphics scheme

## Use cleanplots colors, markers, lines, and theme for all graphs ##
cleanplots_defaults()
theme_update(plot.title.position = "plot")   # titles start at left edge of graph
Back to top