James Silverton said:
Here are the data [....]
Is the fact that I am using straight lines to connect
the points in the graph of importance?
No. But the type of trendline is. You neglect to mention it.
We would expect RSQ of the original data and R^2 of the trendline to be
about the same only if you use a __linear__ trendline. Some relatively
small difference is possible due to floating-point anomalies; that is, due
to the way that Excel represents numbers internally.
But based on the difference you noted previously -- 0.8918 for one, 0.928
for the other, not clear which is which -- I suspect you used an
__exponential__ trendline.
For the data that you posted, RSQ returns 0.921914019817796, and R^2 for the
exponential trendline is 0.894858644182441.
Note that the two R-squares are relatively close to what you mentioned
previously. I presume the difference is because you posted rounded data as
they are displayed and the underlying actual values are slightly different.
Or because you posted different data altogether.
In any case, assuming you used an exponential trendline of the form y =
c*e^(b*x), you can compute the trendline coefficients b and c in Excel as
follows:
B1: =LINEST(LN(Y1:Y31),X1:X31)
C1: =EXP(INDEX(LINEST(LN(Y1:Y31),X1:X31),1,2))
Then you can compute the corresponding data points along the trendline by
putting the following formula into Z1 and copying down:
Z1: =$C$1*EXP($B$1*X1)
Then R^2 might be computed by the formula =RSQ(Y1:Y31,Z1:Z31). Note that
RSQ(knownY,knownX) should not be taken literally to mean Y-axis and X-axis
data.
However, RSQ returns 0.997576649432384, not 0.894858644182441.
I believe the explanation is: there are several definitions of R-squared.
The LINEST help page explains how R-squared is computed for LINEST.
Off-hand, it seems different from RSQ. (The two equations may or may not be
mathematically equivalent for linear trendlines. TBD.)
Frankly, I cannot duplicate the trendline R^2 even using the equations in
the LINEST help page. Perhaps I am making some dumb mistakes (TBD).
But you can recover the LINEST R^2 with the following formula:
=INDEX(LINEST(LN(B1:B31),A1:A31,,TRUE),3,1)
That returns 0.894858644182439. The infinitesimal difference (2E-15) is
probably due to floating-point anomalies in the apparently different
implementations of the LINEST and trendline R^2 algorithms.
Not exactly a dispositive explanation (yet). But at least I've given you
the LINEST formulas that you can use to duplicate the chart trendline.
For the coefficients of other types of trendlines, see
http://spreadsheetpage.com/index.php/tip/chart_trendline_formulas.