In this video we are going to consider the scatterplot.
The plots we have considered up to now have been two dimensional:
but they show a univariate data vector on a 2D plot.
The scatter plot however shows two univariate vectors
of data plotted against each other on a 2D plot.
A scatter plot is created by plotting the first entry from the vectors:
one of the values is shown on the x-axis and the other is on the y-axis.
Then we go to the second entry, and find the intersection of its values on the x- and y-axes.
And so on.
These vectors must, of course, be of equal length.
Here is a plot then of vapour pressure on one axis plotted
against temperature, on the other axis.
Chemical engineers know that, in general, the vapour pressure of a species
in a distillation column will decrease as temperature increases.
This is confirmed in this particular plot,
which shows data from an oil and gas company in Canada.
But notice how scattered the data are: there is measurement error in both variables.
It is not the smooth line that is predicted from theory.
Scatter plots compel the reader
to infer a cause-and-effect relationship between the variables plotted.
In this case, increasing temperature, the cause,
will lead to a decrease in vapour pressure, the effect.
Now take a look at this scatter plot though.
The x-axis shows the number of white hairs on a person's head.
The y-axis shows the bone mineral density, BMD.
People with low BMD are prone to higher rates of bone fracture, as their bones are more fragile.
Pause the video, and answer this question: is there a cause-and-effect relationship here?
The answer is clearly not: if there were a relationship,
we could improve a person's bone mineral density by simply colouring their hair.
White hairs don't cause low BMD, and low BMD does not cause white hairs either.
What we are observing here is simply a correlation between two variables.
There is a third variable, which is not shown: that is the person's age.
As people get older, the number of white hairs increase.
As people get older their bone mineral density decreases.
That third variable, age, is a hidden variable not shown here on the plots.
We have to understand our system to discover it.
That was a simple example, but in your career as an engineer you will be
"tricked" many times by hidden variables.
You will plot a scatter plot between 2 variables and notice a trend,
and think you have discovered an interesting cause-and-effect relationship.
But, always ask yourself: could it be something else that is causing this?
We will come back to this important topic at the end of the course, when we look at experiments.
Experiments are the ultimate way to prove cause and effect.
Experiments will break these correlations which would have otherwise tricked us.
Here's is another correlation: the number of hours worked per week on the x-axis,
and the y-axis is the GDP per person, a measure of productivity.
Note that the word "engaged" here in the x-axis is used in the British English sense,
and not in the sense of marriage.
The linked article provides a fascinating explanation
as to the cause-and-effect relationships shown here on the scatterplot.
Scatter plots are a great tool to reduce data ink: to start with,
they show two variables on two axes.
To improve data ink use on a scatter plot, makes your axes fit the data tightly.
Look back at all three scatter plots shown: you don't have to start your axis at zero.
But that's the default in many software tools and you often have to change it.
A good software tool is R: it has sensible defaults built-in by researchers
and designers that study those topics.
I find I almost never have to adjust my R plots.
Also, avoid heavy grid lines: the human eye is actually remarkably good at imputing horizontal
and vertical lines where none actually exist.
Scatter plots are a tool that we are comfortable with as scientists and engineers.
However, we often believe that others are not capable
of understanding and reading these plots.
The evidence for that statement is that we so seldom see these plots in operator control rooms
and reports that engineers write for managers and other non-engineers.
This is unfortunate.
Edward Tufte has studied the media of Western newspapers
and found almost no scatter plots are used;
Japanese newspapers on the other hand use several.
This is unusual, because it has been shown that 12 years and older understand how to read
and interpret such scatter plots.
A university education is not required.
To illustrate this, take a diversion and watch this video by Hans Rosling,
from a BBC recording he made a few years ago.
Notice in his video the use of scatter plots.
Not only two variables though: he uses the size of the marker to illustrate a 3rd variable,
and the colour of the marker is a 4th categorical variable.
So that is 4 dimensions on a 2D plot.
Then, when he animates the graph through history, time now becomes a 5th dimension.
If you had virtual reality 3D glasses you could add a 6th dimension with x, y and z axes.
Could this be a tool that engineers and operators use
to better understand and control their processes?
Here's the link for the video.
Please watch, and then come back.
So to end off the video, let's address a shortcoming of scatter plots:
we can lose the ability to tell the density of each of the variables,
especially if points on the plot overlap.
There are interesting ways to overcome this.
On the left is a scatterplot showing data from 21,000 people.
It illustrates their eduction level on the x-axis, plotted against their vocabulary level.
Notice the points overlap, and we don't get an indication that there's 21,000 data points here.
But, if we add a little bit of noise, statisticians call this process "jittering",
then the density in the data become more apparent.
Another way we can recover the density of the data is
by adding box plots outside the axes, as shown here.
Alternatively, histograms can work just as well.
So that's all the material for the visualization module.
There are so many topics we could have covered.
This area has been rapidly evolving over the past 10 years.
Many blogs and visualization websites have been started.
This was an activate area of research in the 1960's, and it has been revived again.
Thirty years ago it was difficult to plot good data;
but these days we have excellent software packages that are freely available.
Unfortunately many of you will still encounter these legacy plots and tools in the workplace.
Good plots are not difficult to create, but it does take time and careful thought
about what you can remove and add to the plot, to help get your message across.