Skip navigation

Automatically displaying the R-squared value on a scatter plot

score 53
You have not voted. Active

Create a dynamic text object that displays elements of the trend model for a given plot


The following blog post describes how to find the r-squared value for a scatter plot and how to take the square root to get the Pearson correlation coefficient (r).  This approach works fine for one, or possibly a few scatter plots, but doesn't work well if a multitude of plots are being created.  In many cases, I use the page shelf to sweep through time, comparing variables from one month to another such that many scatter plots are being created.  Although Tableau draws the trend line on each of the plots, the description of the trend model (i.e., r-squared...) has to be cut and pasted into an annotation area for each plot individually.  This effectively defeats the purpose of using the page shelf.  It would be fantastic if a dynamic object can be designed and placed on the plot in an annotation area to show r-squared = 0.89 (or other statistical indicator) for each plot created using the page shelf.  This simple addition would make using the page shelf much more robust.


Vote history