A Grammar of Graphics

STAT 20: Introduction to Probability and Statistics

Concept Questions

  1. What are the aesthetics and geometry of this plot?
01:00

What code was used to make this plot?

01:00

Global infectious disease prevalence in 1989

A bubble chart showing the prevalence of different infectious diseases. Each disease is represented by a bubble, its size is mapped to the prevalance, and it's biological family is mapped to color. The largest bubble is labeled HIV and is green, representing viruses.
  1. What are the aesthetics and geometry of this plot?
01:00

Concept Activity

Concept Activity

You will be watching a 2.5 minute video of a presentation by a scientist, Hans Rosling, who studied global public health. He presents data visualizations depicting the change in life expectancy and family size over several decades in the 20th century.

On a piece of note paper:

  • Sketch out the data frame used to create the graphic and add the names of the variables.
  • List the aesthetic attributes used to encode the data in the graphic.
  • Identify the geometry used in the plot.

Please turn to your neighbors and…

Discuss what you came up with in terms of . . .

  • the variables present in the data frame
  • the aesthetic attributes used to encode that data in the plot
  • the geometry
01:00

What were the variables and aesthetic attributes?

Visual Cues / Aesthetics

  • Location along the x-axis
  • Location along the y-axis
  • Size of point
  • Color of point
  • Animation

Variables

  • Fertility rate
  • Life expectancy
  • Population
  • Region
  • Year

What did the data frame look like?

What was the unit of observation? What were the variables? What were their type?

Unit of observation

  • A country in a given year

Variables

  • Fertility rate (continuous)
  • Life expectancy (continuous)
  • Population (continuous)
  • Region (nominal)
  • Year (discrete)

What geometry is used to represent the observations?

  • Points

Quiz Recap

  • Head to pollev.com for a series of former quiz questions and quiz-level questions! Make sure you take notes.

What type of claim was made?

The group Morning Consult conducted a poll of a representative sample of registered 1,256 Republican voters on August 24, 2023, asking them who they planned to vote for in the primary eleection. 58% of respondents replied “Trump” and 14% replied “DeSantis”. A major news outlet ran a headline, “Trump leads DeSantis by 44 points among registered Republican voters.” . . .

01:00

What type of variable is listeners?

{fig-alt=“A dataframe with a column labelled ‘Listeners (in million)’ with values 40, 66, 60, 73, 57, 75, and 13’}

01:00

What type of proportion is used?

An image of a stacked bar chart with the classes along the x-asis - 1, 2, and 3 - and the bars filled with black or gray based the proportion that survived or perished.

Roughly 68 percent of those passengers who were in the first class survived the wreckage of the Titanic.

01:00

Which measure of center/spread is least appropriate?

01:00

What are the aesthetics and geometry of this plot?

01:00

What has not changed when moving from left to right?

Break

05:00

Worksheet: A Grammar of Graphics

15:00