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
- What variables should correspond to the x- and y-axes?
- What variables should be encoded with color or size?
- 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
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.
- Remove the observations with
NULL
in theYear
in school. Re-order the year variable to be in a reasonable sort order. - Create a scatter plot with
SAT
on the x-axis and CollegeGPA
on the y-axis. - 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. - Create a graph with side-by-side boxplots for
GPA
on the y-axis andYear
on the x-axis and color code byGender
.
- Remove the observations with