Using LINEST in Excel
Using LINEST in Excel
Enter "=linest(" and follow the prompts, or choose LINEST from the Insert Function menu (in Statistical).
Choose the Ys.
Choose one or more X columns (one for linear, two for quadratic etc; you have to make X X^2 X^3 etc columns)
Enter true, true (or 1, 1).
Enter a ")" to finish the function and hit Enter.
Select the cell, then shift-select 5 rows and 2 (for one X) or more columns
Hit F2 then control-shift-enter, incredibly. Bill Gates strikes again.
The polynomial is Y = m0 + m1.X + m2.X^2 +…
You can also fit polynomials with the Analysis Toolpak:
select Tools/Addin-ins/Analysis Toolpak,then Tools/Data Analysis/Regression.
For the examples below, I have added some statistics
y x x2
4.0 1 1
9.0
7.5 2 4
8.0
8.0 3 9
7.0 f(x) = - 1.18x^2 + 6.42x - 1
5.0 4 16 R² = 0.95
2.0 5 25 6.0
5.0
4.0
y
Quadratic -1.18 6.42 -1.00 coeffs m2 m1 m0
3.0
0.20 1.23 1.61 SEs SEm2 SEm1 SEm0
2.0
0.954 0.75 #N/A Rsq SEE -
20.97 2 #N/A F Deg Free - 1.0
23.67 1.13 #N/A SSreg SSres - 0.0
1 1 2 2 3 3 4 4
adj Rsq 0.909 See note below about bias in correlations. x
Rsq 0.954 Rsq=SSreg/(SSreg+SSres)
Rsq 0.170
3.0
Pearson -0.413
2.0
Pearson^2 0.170
1.0
0.0
Here is an example with data across the page: 1 1 2 2 3 3 4 4
Data are peak power (W) at various percents on 1RM on a Smith machine x
% of 1RM X 20 30 40 50 60 70 m2 m1 m0
X^2 400 900 1600 2500 3600 4900 err m2 err m1 err m0
Rsq SEE -
Subject
Ariel 790 805 815 800 760 720 -0.08 6.21 698.93
0.01 0.75 15.40
0.99 5.03 #N/A
Gene 640 690 700 705 695 670 -0.08 7.80 520.64
0.01 0.89 18.19
0.96 5.94 #N/A
1 2 2 3 3 4 4 5 5 6
x
840
820
1 2 2 3 3 4 4 5 5 8006= - 0.0848214286x^2 + 6.2053571429x + 698.9285714286
f(x)
780
x 760
740
720
700
680
Maximum 660
occurs at value is 10 20 30 40 50 60 70 80
36.6 812.4
720
680
660
640
620
600
720
660
640
620
600
10 20 30 40 50 60 70 80
also biased.
the square root of a negative number..