知识库

How to Export the Residual of Linear Regression Model Other Than Access


发布时间: 21 Jul 2022
上次修改日期: 17 Apr 2023

问题

How to export Residuals data of a Linear Regression Model in another format than Access.

For example, when you export the data of the Linear Regression plot graph as Data(Access),
User-added image

It will show Prediction and Residual in the export file.
User-added image

It will not show Prediction and Residual in Crosstab(Excel) export file.
User-added image

 

环境

  • Tableau Desktop
  • Windows
  • MacOS

答案

The ability to export Residuals data of a Linear Regression Model in another format than Access is not currently built into Tableau Desktop.
Instead of outputting the residual data, you can create formulas for the forecast and residuals in the original workbook, which can be used in the same way as Access data

The formulas required are as follows

1. slope: [correlation] * ([std deviation of y] / [std deviation of x])
User-added image

2. y-intercept: Avg[y variable] – [slope] * Avg[x variable]
User-added image

3. Prediction: {[slope]} * [x] + {[y-intercept]}
User-added image

4. Residual: observed y - predicted y
User-added image

The Residuals from the above calculations are the same as the output data in Access.
User-added image

Please also check the attached workbook for details.

其他信息

To voice your support for the inclusion of this feature in the future release of the product, vote for the following idea on Community.
show trend model & residual or export the details
https://community.tableau.com/s/idea/0874T000000HB88QAG/detail
此文章是否已解决问题?