Calculating 2 x r squared values

JeffGrant

Well-known Member
Joined
Apr 7, 2021
Messages
558
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I have two trend lines generated from the same data. As you can in the chart, the polynomial trend line creates an R squared value of 1. The linear regression trendline creates an R squared value of 0.148.
1631418002560.png


My data set is

XY
57.5​
16.56​
52​
16.34​
54​
16.76​

Using LINEST(B2:B4,A2:A4^{1,2}), I can get the co-efficients of the polynomial.
Using LINEST(B2:B4,A2:A4), I can get the slope and intercept of the linear trend line.
Using RSQ(B2:B4,A2:A4), I can get the R-Squared value of the linear trend line

How can I get the R-Squared value of the polynomial from the same dataset?

I have tried a few alternative methods to calculate the R Squared and it always calculates the values for the Linear Trend line, not the polynomial.

I really would like to have both R-Squared values in the same sheet, so the I can switch formulas as the data changes.

Thanks in advance
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Try this:
Book1
ABCDEFGH
1XY
257.516.56
35216.34
45416.761
5
6
Sheet3
Cell Formulas
RangeFormula
E4E4=INDEX(LINEST(B2:B4,A2:A4^{1,2},TRUE,TRUE),3,1)


To get R-squared as a cell value for different types of trendlines:

Linear
Excel Formula:
=RSQ(known_ys, known_xs)
Power
Excel Formula:
=RSQ(LN(known_ys), LN(known_xs))
Logarithmic
Excel Formula:
=RSQ(LN(known_ys), known_xs)
Exponential
Excel Formula:
=RSQ(known_ys,LN(known_xs))
Polynomial (2nd degree)
Excel Formula:
=INDEX(LINEST(known_ys,known_xs^{1,2},TRUE,TRUE),3,1)
Polynomial (3rd degree)
Excel Formula:
=INDEX(LINEST(known_ys,known_xs^{1,2,3},TRUE,TRUE),3,1)
 
Upvote 0
Solution

Forum statistics

Threads
1,224,507
Messages
6,179,176
Members
452,893
Latest member
denay

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top