In last post you handled your manager’s request using Linear Regression in R. Your manager is a big fan of Tableau and she would like you to present the result in Tableau. How would you do it?
The process is very easy, with no coding required at all.
First let’s import the data.


Then we go to the worksheet, drag Advertising Volume to the Columns Shelf, and Sales Volume to the Rows Shelf. We also drag Month to the Marks. A scatter plot has been created.

Now go to Analytics beside Data, double click Trend Line. A trend line will be added. If you hover the mouse over the trend line, you will find the model formula: Sales Volume (M $) = 5.02705*Advertising Volume (M $) + 0.433718.

Right click the trend line you see the option of ‘Describe Trend Model’.

Click ‘Describe Tend Model’ then you will get a pretty informative model summary, similar to what you get using other tools (Excel, Python, R, etc.)

One thought on “Linear Regression in Tableau”