Math 121 - Calculus for Biology I
Fall Semester, 2003
Appendix for Least Squares Analysis

 © 2001, All Rights Reserved, SDSU & Joseph M. Mahaffy
San Diego State University -- This page last updated 10-Aug-02

Appendix for Least Squares Analysis

 

y(x) = ax + b.

ei = yi - y(xi) = yi - (axi + b), i = 1,...n.

with respect to the variables a and b.

 

 

The details of this analysis are omitted, since it does require a little more knowledge of Calculus. First, we define the mean of the x values of the data points as

The value for the slope of the line that best fits the data is given by

With the slope computed, the intercept is found from the formula

 

Example: Let us apply this to our example beginning the main section. There are four data points in the E. coli example, (10,7130), (20,4580), (30,2420), and (40,810). First we compute the mean of the times

The slope a is found by the following calculation.

Similarly, the c-intercept, b, is readily computed to give

The answer on the main page rounds the values of a and b to three significant figures.