Using Excel to Do Least Squares
-
Upload
ahmad-ullah -
Category
Documents
-
view
213 -
download
0
Transcript of Using Excel to Do Least Squares
-
7/24/2019 Using Excel to Do Least Squares
1/3
Slope= 0.9983 error in slope= 0.012Intercept= 0.0083 error in intercept = 0.067
Using Excel to do least squares
s an example, data points given in table (1) will be used to perform lease squ
ethod. From these data we will find the slope and the intercept of the graph of Y vs
1. Enter data in two columns, X (l/T values) first, then Y (ln(k)) values, for exam
2. Select a 2 x 2 array (2 rows and columns) anywhere on the spreadsheet.
3. In the formula pane type =Linest(B2:B10,A2:A10,true,true). Where the rang
B2:B10 determines theY values and the range A2:A10 determines the X value
4. Do CTRLSHIFT ENTER to enter the formula in the array.
5. The least squares numbers that fit to a straight line will appear as:
Slope Intercept
Std. Dev.Slope Std. Dev. Intercept
Table (1).X
y
1.0 1.1
2.0 2.0
3.0 2.9
4.0 3.9
5.0 5.0
6.0 6.1
7.0
7.0
8.0 8.1
9.0 8.9
-
7/24/2019 Using Excel to Do Least Squares
2/3
Slope= 0.9983 error in slope= 0.012Intercept= 0.0083 error in intercept = 0.067
Once you get the slope and intercept, select the two data columns (A and
in the example), click on INSERTon Charts, choose scatter diagram.
Then on graph that showed up, click on a point with left button and then
click right button on mouseformat trendline appearschoose linear,
then display equation and R-squared. Closer R squared is to 1, better the
linear fit.
-
7/24/2019 Using Excel to Do Least Squares
3/3
Slope= 0.9983 error in slope= 0.012Intercept= 0.0083 error in intercept = 0.067