STA1000 - Data Analytics and Metrics
In Lecture 2 we opened insta-data.csv, cleaned and transformed data, and identified the type of each variable: categorical or continuous.
We also met Tableau: Data Source, Worksheet and Dashboard, with Dimensions for categorical variables and Measures for continuous ones.
Today it is time to look at the data: which figure for which variables, and how to build it in Tableau.
Data visualisations are important:
Figures can also lie or mislead: use them with ethics and professionalism.

Based on Andrew Abela’s Chart Chooser: start from the question, not from the chart
A figure aggregates data into information with basic statistical calculations
| Student | Group | Mark |
|---|---|---|
| S1 | A | 60 |
| S2 | B | 70 |
| S3 | A | 60 |
| S4 | B | 55 |
| S5 | A | 65 |
| S6 | B | 65 |
| S7 | A | 65 |


Sort the values, then cut them into four groups of equal size. The interquartile range (IQR = Q3 - Q1) holds the middle 50% of the data.


The line that best fits the points of two continuous variables is a regression line: Y = b₀ + b₁X + e

The correlation (r) is the slope of the regression line once both variables are on the same scale. It measures how closely the points follow a straight line, from -1 to +1:

In Tableau, categorical = Dimension and continuous = Measure.
Variable(s) in insta-data.csv |
Family |
|---|---|
format |
|
reach |
|
format and reach |
|
format and is_paid |
|
impressions and likes |
|
theme |
Variable(s) in insta-data.csv |
Family | Figure |
|---|---|---|
format |
Composition | Bar chart |
reach |
Distribution | Histogram, box plot |
format and reach |
Comparison | Box plots |
format and is_paid |
Comparison | Stacked bars |
impressions and likes |
Relationship | Scatterplot |
theme |
Composition | Bar chart, not a pie |
Count of the different categories

Proportion of the different categories

Only when the variable has two categories

With more categories, use a bar chart

Here is a pie chart that works:

Four figures of one continuous variable, reach

Each figure keeps something and throws the rest away: the dynamite keeps only the mean.

Reach is right-skewed: most posts reach a few thousand accounts, a few reach tens of thousands, and one reel reached 535,086.
The mean (9,788) is pulled towards that tail. The median (5,184) is the typical post.
Mean ± SD = 9,788 ± 27,748: a range that goes below zero, for a count that cannot be negative.
Two categorical variables: format and is_paid

A categorical and a continuous variable: format and reach

Two continuous variables: impressions and likes

Adding a categorical variable: one panel per format, same axes

For the same impressions, carousels earn about 6 likes per 100 impressions and reels fewer than 3.

A family of figures for each type of variable:
Show Me highlights the figures they allow, it also explicitely indicate what combinaison of Dimension and Measure is needed.

A Dimension on Columns and the count field on Rows. For percentages, open the menu of the count pill (click its arrow, or right-click / ⌃ Control + click) → Quick Table Calculation → Percent of Total.
The recordings in this section use another dataset: the clicks are the same with insta-data.csv.

Only for variables with two categories: the Dimension on Columns, the count on Rows, then Show Me → pie chart.
Tableau does not draw every distribution figure:


A Measure on Rows, then Show Me → histogram.
Tableau creates a new field, variable (bin): to change the width of the bars, open its menu → Edit.


With insta-data.csv, one worksheet each:
format: count, then percent of totalis_paidreach: where are most posts?reach, post_id on Detail: which post is the highest dot?reach as an Average, then as a Median: which would you report?Add a Dimension on Colour, Columns or Rows to any of the previous figures: bar or pie charts with the count, histograms, box plots, bar charts with the average.



A second Dimension on Columns puts the bars side by side; on Colour, it tells the groups apart.

A Dimension on Rows: one histogram per group

A Dimension on Columns: one box per group
The scatterplot is the best way to show the relationship between 2 Measures, but:



Two Measures on Columns and Rows, each switched to Dimension. Analytics pane → Trend Line → Linear. A Dimension on Colour gives one line per group: hover a line to read its R² and p-value.
format, with is_paid on Colourreach by format: which format has the highest median?reach by format: which format wins now, and why?impressions against likes with a trend line, then format on Colour: which format earns the most likes per impression?Save the workbook to your Tableau Public profile: Lecture 5 turns these sheets into a dashboard.

Thanks for your attention and don’t hesitate to ask if you have any questions!