3 Replies Latest reply on Aug 3, 2016 8:05 AM by Carl Slifer

    Export Exact Trend Line Formula?

    Benjamin Greene

      Hey all, I'm wondering if there is a way to copy or export or even simply view an exact formula (or at least more precise than 5-7 decimals) for a generated trend line. I ask because, when working with polynomial trend lines of a high degree, the rounded values Tableau shows often are not precise enough to give the correct value when raised to the 5th power, for instance.


      For clarity, I have created an example of the issue I'm having in the attached packaged workbook. I generated a series of X and Y values and had Tableau calculate a 5th-degree polynomial trend line. I then copied the text in the Describe Trend Line box and used that formula to plot the Predicted Y values in the same chart with synchronized axes. As you can see, the predicted values do not line up with the trend line, even though they have the "same" formula.

      P-value:< 0.0001Equation:Y = 5.11757e-12*X^5 + -1.93172e-08*X^4 + 2.90941e-05*X^3 + -0.0218555*X^2 + 8.18894*X + -1224.37


        • 1. Re: Export Exact Trend Line Formula?
          Dmitry Chirkov

          We currently don't expose exact numbers used in these sort of calculations, sorry! (plus formatting is inconsistent between tooltip and Describe Trend Line dialog)


          Curious though - why do you have a need to replicate this formula?

          • 2. Re: Export Exact Trend Line Formula?
            Benjamin Greene

            I am working with cross-sectional data, so I was trying to see how someone's probability of Y occurring changes, given their value for X. So I fit a trend line using all the observations that I have both X and Y values for and was hoping to apply that trend line to those observations that I only have X values for, to get a predicted Y value. However, as you can see in the packaged workbook, the predicted values aren't coming out quite right.


            I ended up just using Excel's LINEST array formula to obtain exact coefficient values.

            • 3. Re: Export Exact Trend Line Formula?
              Carl Slifer

              Hi Benjamin,


              You're right it's a significant difference on a graph and its not a simple transformation.  I'm not the most skilled R programmer in the world in fact probably barely even considered an R anything. But this might be a case to link Tableau to R and to pull the calculated trend line data off from it, especially something as large and complicated as a 5th degree polynomial trendline to calculate. Have you looked into this route?


              Best Regards,

              Carl Slifer