Chapter 5 Basic Graphs

It is important to know how to create basic graphs and the technical process for doing so. In part, it forces us to confront basic questions like

  1. What variables should correspond to the x- and y-axes?
  2. What variables should be encoded with color or size?
  3. What variables should be encoded as I switch facets (groups)?

But before those question can be addressed thoughtfully, we must understand that they are even an option.

There are many different graphing software packages and a user should concentrate on learning at least one package. I do most of my graphing using ggplot2 in R and I have a tutorial on it.

For this book (and class) we will focus on using Tableau Desktop. I’ve developed a few Youtube videos to introduce how to interact with this software.

5.1 Creating a basic graph

5.2 Light pre-processing and adjusting labels

5.3 Exporting the graph to MS Word

5.4 Selecting EPTs is done using the Marks pane

5.5 Creating Histograms, Boxplots, and Regression Lines

5.6 Exercises

  1. For the following exercises we’ll use the Student Survey data which is available at the book’s GitHub site in the data-raw directory. Recall this data set is the result of a several years of survey’s in a college level introductory statistics class at a St. Lawerence University.

    1. Remove the observations with NULL in the Year in school. Re-order the year variable to be in a reasonable sort order.
    2. Create a scatter plot with SAT on the x-axis and College GPA on the y-axis.
    3. Create a bar-chart that shows the number of Piercings. Make this with separate charts for males and females, with the charts stacked on-top of each other.
    4. Create a graph with side-by-side boxplots for GPA on the y-axis and Year on the x-axis and color code by Gender.