-
Book Overview & Buying
-
Table Of Contents
Data Analysis Using SQL and Excel - Second Edition
By :
There are two reasons for explaining the arithmetic for calculating the coefficients of the best-fit line. Directly calculating the coefficients makes it possible to do the calculation in SQL as well as Excel. More importantly, though, Excel is missing a bit of useful functionality: the ability to do a weighted best-fit line, which is addressed later in this chapter.
Calculating the best-fit line means finding the values of the coefficients ß1 and ß0 in the equation for the line. The mathematics needed for the calculation is simple addition, multiplication, and division. There is nothing magical about the calculation itself, although the proof that it works is beyond the scope of this book.
The calculation uses the following easily calculated intermediate results:
Change the font size
Change margin width
Change background colour