Chapter 6 - Fitting Data Sets

6.3 Linear Regression

Typical data sets are noisy. These data points do not lie on smooth curves, but are spread over some interval in the y-direction. The purpose of the linear regression or straight line fit is to find the straight line which fits the data set best. The straight line equation is

So the problem is to find values for the slope "m" and intercept "b" which produce the best fitting line for a given data set. For instance, the data set weight_data will be used below to illustrate the steps in using Excel to perform this fit.

 

We will assume that the data set is already imported in Excel ( height (x) in column b4:b21 and weight (y) in column c4:c21 ) in what follows.

The steps are:

  1. Create a table for the parameters of the straight lines, m and b, and label the cell properly

  1. Maple provides a function 

                   slope( known y's, known x's) 

    which allows to compute the best slope ( note the order ). This function is used to find m. The slope function can be found under the insert function under statistics.

  1. The function 

                  intercept( known y's, known x's) 

    allows to find the intercept for the best straight line.

  1. The fitted function (straight line) 
      
     is then calculated in a new column next to the original data

  1. The data and "fitted function" are then plotted simultaneously in a single graph.

 


 
Section 6.2 Chapter 6 Section 6.4       TOC

Any questions or suggestions should be directed to
Michel Vallières at vallieres@physics.drexel.edu