Grammar of Graphics Revisited

Albert Y. Kim
Monday 2015/04/27

Administrative Notes

  • Juniors and younger: new course next year MATH 243 Statistical Learning. This will be about machine learning on big data.
  • Andrew Bray giving a talk this Thursday at 4:10 in Physics 123.

London Underground Map

Behold, the London Underground map, in all of its glory!

Iterating to Perfection

Mapping of Variables to Aesthetics

Think in terms of aesthetics, as defined by The Grammar of Graphics

  • color of line: which line of underground (Bakerloo, Picadilly, Northern, etc.)
  • type of point: standard station vs interchange station
  • (x, y) position and line: relative ordering of stations, NOT actual geographic location of station.
  • blue lines: River Thames

(x,y) Position and Line

The (x,y) positions on the map are distortions of the actual locations. Check out the geographically faithful map.

(x,y) Position and Line

The Beck map:

  • Compresses geographically spread out suburban stations
  • Expands out geographically compressed urban stations
  • Most importantly: it only uses straight lines at 45 and 90 degree angles.

Subway Map Convention

Almost every subway map in the world follows this format.

Brain Candy: Cameron Booth's Interstate subway map

Exercise

Open dataset.csv on Moodle or GitHub, load in R, and for each of the 4 levels of group:

  • Compute the means and sd's for both x and y
  • Compute the correlation coefficient between x and y using the cor() function
  • Get the coefficients of the linear regression y~x.

Anscombe's Quartet

This dataset is known as Anscombe's Quartet which has near identical summary statistics (means, standard deviations, correlation coefficients, and regression coefficient).

They were developped to demonstrate both the importance of graphing data before analyzing it and the effect of outliers on statistical properties.

PLOS Biology Paper

Go to my Twitter account and check-out my retweet of @rhobott of a PLOS Biology paper.

Example

Adriana Escobedo-Land's thesis:

  • Let's consider her problem:
  • Analysis

Some Nice Morals

  • Don't fear simplicity
  • It's a question of tools
    • You can't use a water bottle to extinguish a forest fire.
    • You don't need a fire hydrant to extinguish a candle.