Hey, it's Tim here in today's video. I'm going to show you how to build this scatter
plot in just two minutes. I'm looking at life expectancy data again, and this time we're
going to look at some slightly different sort of comparisons. We're going to take add up
mortality, put it up on columns, and we'll take life expectancy and put it on rows.
Now we get one data point and technically this is already a scatter plot. It's not telling
us much though, so let's add more context to the chart. If we go ahead and put country
on detail, you'll see that we get a dot for each and every country. Now we're starting
to see a bit more of a story. However, it's important to notice that Tableau is aggregating
this. That's a default aggregation, a sum. You can change the default aggregation in Tableau,
but I'll just change it here in the chart by just going to average. I'll go there to
select average again. Now what this is doing is it's averaging all the values because this
data does span multiple years. If I want to put the years on this chart as well, you
can notice here that they're continuous. What I can do is I can actually convert that to
discrete, go ahead, put year on detail, and now we get more dots that convey the story
a little bit better. If we look at this, we've got add up mortality going up here on the
right hand side, the higher the value, the worse the mortality rate, and life expectancy
going up. This is a bit of a weird way to look at this. Really what we should have, I
think, is if I just flip the chart around like this, this makes more sense. Mortality
going up on the left and life expectancy going down on the bottom. To me, life expectancy
as the x-axis makes sense because it's almost like a scale going from left to right. There's
something about that just makes it a little bit more sense. Now what we can do is we can
format this a little bit. You can see it's set to automatic and it's using multiple shapes.
We don't need that. We can just have one circle that will do us fine. We'll make this a little
bit smaller. What we'll notice is there's quite a bit of overlap with the data. I'll
bring this down to about 78%, and I'll make a dark border. Actually, with this one, I
can make a white border so all the dots are a little bit easier to see. Now, this is something
you'd only ever see in a scatter plot. It's quite convenient that there seems to be no
data falling around the 60 mark, 70 mark, and even the 80 mark. Then again, at 100, and
some of these other groupings. What this might suggest is there's a little bit of something
going on with the data collection or the data storage that means that I think those data
points are being felt today. It's too coincidental that those lines are a bit disparate. Now,
one thing you could do to tell a story with this is actually try and add a little bit
more context. Let's say I wanted to analyze a particular set of countries. In this case,
I'll go choose United States and United Kingdom. Let's go ahead and choose those two. I want
to compare them versus every other country. What I've done there is I've created a set.
I'll put the set on color. You can see that it colors each and every one of those dots
that represents those countries in the visualization. They're just here at the bottom. You can just
see them. The next thing I can do is I can add a trend line. If I show trend lines, what
the trend line will do is we'll look for see what's on the color pane and actually use
those to split the trend line. The blue is the United States and United Kingdom, and
the gray is every other country. Because we're looking at averages, this is now starting to
tell us a bit more of a story. Typically, United States and United Kingdom have had
fairly low adult mortality rates, which means that the more they've improved adult mortality,
the less of effect it's had on a life expectancy. Whereas for some countries, pretty much every
other country in the world, there's a much, much higher correlation there. You can see
that effect happening. That's pretty much it. Run out of time. Thanks for watching. If
you haven't subscribed yet, please subscribe and I'll catch you in the next video.