Lab 9 – Graphing Data

Your primary resource for today is Visual Analytics with Tableau, chapters 1 and 3.

Today, our hard work with data preparation begins to pay off as we start to visualize our data as a way of understanding what is going on in the data and as a way to communicate about the data.

Let’s fire up Tableau Desktop!

Connect to data, like we’ve done in Tableau Prep, but this time choose “More…” under “To a File” and choose the truncated longitudinal data file in Box.

select data file in Tableau Desktop

Just like in Prep, we start with an overview of our data.Data preview in Tableau

Let’s do a little double checking on our data types.

This window operates a lot like Prep — in here we can merge data files, transform data, and clean data.

Once your data looks you want, click “Sheet 1” on the lower left corner of your screen.

Welcome to the Tableau graphing interface.

Tableau interface

All right. What seems familiar to you?

Building a Graph

First thing to notice is the far left side has the column names from the data divided in half. The top half are the dimensions – descriptive or categorical variables; the bottom are the measure — numeric variables that you can compute. If a variable is miscategorized, you can drag it into place.

Grab one of the measures, and drag it into the “Drop field here” area on the left of the canvass.

Graph of total adherents

graph of adherents

Congratulations! You’ve made your first graph!

Take a moment and celebrate.

Ok, so in all fairness, it isn’t a very interesting graph. So let’s spice it up.

Let’s start by splitting out the data along one of the descriptive dimensions. I am going to use “Year” but you are welcome to try another variable.

Grab “year” and drop it into the top column box.

Initial visualization from adding "year"

Better! But …. how well does this match the data?

Remember last week when we talked about the graphs attending to the world they represent? This graph assumes that time is continuous — a good assumption for most of the data that people use Tableau for. But we have survey data where the connection between the two is tenuous at best.

We can control the type of graph using the “Marks” dropdown menu. Which of these graph types would be a better choice?

adjust the graph marks with the Tableau dropdown

Bar charts are a good choice for us, because the data from each year is distinct, so let’s select that from the drop down.

Data as bar graph

Good. But why such a big gap between our data? And why so many years?

 

 

[think about it]

 

 

 

If you guessed “my data type is probably wrong,” you are a winner!

To adjust that, click on the arrow on the right side of the “Year” variables in the top “column” area. changing variable type from menu.

We can change the data type from “Continuous” to “Discrete.”

improved graph showing data discretely by year.

Better!

Ok, what if we want to show how that total breaks down by religious tradition?

This is where all the boxes in the middle come into play, where you can assign a different mark or encoding to different features of the data.

Drag “Religious Tradition” over to the “Color” box.

transformed into a stacked bar graph

Well done! Now we are starting to see something interesting – like what happened to the Black Protestant churches in 2000?!

Finally, some housekeeping. Let’s rename our sheet to be something more descriptive. Like, “Sum of Alabama Adherents by Religious Tradition, by Year.” Keep in mind, like we learned in our readings, that all these labeling steps are part of the rhetorical strategy of the visualization, telling the reader what to look at and how to look.

Now, click the new workbook button to create a new canvass.New workbook button in Tableau

We are going to learn through exploration – go ahead and try some different configurations of the data, different chart types, etc. to get a feel for the software.

Remember, “Useful charts are charts that have a clear purpose: they convey a message, answer questions, or provoke new questions and discussions.” (p. 49)

Homework

Create three new graphs that represent your data and export them as PNG files. Post them to your blog with a brief description of what they represent.

Posted in Lab