Get startedGet started for free

Tableau: trend lines

1. Tableau: trend lines

In this demo, you'll find out how to create a scatter plot and add a trend line. The data we'll be using is called the windmill data set, and holds the wind speed and corresponding power output of 365 windmills. To create a scatter plot, you first need to disaggregate your data. Recall that there are two ways to do this. If you have a unique row identifier, you can drag that to the Detail mark. In this case, we have one observation for each windmill. If we then draw power output and wind speed to the canvas, Tableau will create a scatter plot, with each point representing a windmill. The other way is by clicking the Analysis menu and then tick off Aggregate Measures. This is the safest way: each row will be represented as a single point, even if you would have multiple observations for a windmill by accident. This method of disaggregation doesn't require a unique identifier, but it isn't possible to exclude data points if you want to leave out extreme values for an ad hoc analysis, for example. For this reason, I'm going to pick the first option. It is clear that, when wind speed increases, the power output increases as well. A trend line can be added to enhance the visualization of this relationship and can be done in two ways: by right clicking on the graph, selecting Trend Lines, and then Show Trend Lines. The second way is via the Analytics pane, and drag and drop the trend line of choice on the graph. A linear trend looks like a nice approximation of the relationship between wind speed and power output. However, at low and high wind speeds, the trend line seems to deviate from the observations. If we were to include these middle observations only, the trend line would be the perfect representation of the relationship. Notice how Tableau automatically draws a new trend line based on your selection. This is known as instant analytics, and allows you to compare subsets of data. You could also see the impact of excluding a single observation, such as this one, but since there is no reason to omit this data point, we keep it. What about other trend lines? To edit a trend line, right click the plot, select Trend Lines, and then Edit All Trend Lines. Now, we can cycle through the options. It seems that a third degree polynomial trend line fits the data even better. It nicely captures the reduced power output at lower wind speeds, and seems to cap when wind speeds are above 14 m/s. Notice that the trend line predicts a power output of about 2 Megawatts when it is windless. This is of course impossible, and is a good example that extrapolation does not always yield realistic predictions. Always consider the context of your data properly before making conclusions. In the exercises, you'll be working with a dataset containing 77 dinosaur species, each with their own femur or thigh bone length in mm, and mass in kg. Each species also belongs to a clade, or group of related dinosaurs. Time to dig up some bones!

2. Let's practice!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.