next up previous contents index
Next: More on Simple Regression Up: Linear Regression Previous: Simple Linear Regression

Calculating the Least Squares Regression Line

  One way to calculate the regression line is to use the five summary statistics $\overline{X}$, $\mbox{SD}_X$, $\overline{Y}$, $\mbox{SD}_Y$, and r (i.e. the mean and SD of X, the mean and SD of Y, and the Pearson correlation between X and Y.) The least squares regression line is represented by the equation  

PREDICTED Y = a + b X

where the slope b and intercept a are calculated in the following order:  

\begin{displaymath}\begin{array}{ll}
b = r \frac{ \mbox{SD}_Y}{\mbox{SD}_X}, &
\;\;a = \overline{Y} - b \overline{X}
\end{array}\end{displaymath}

Consider the Saturn Price data. We let Y=Price and X=Miles since we want to estimate Price given a value of Miles (not vice versa). Calculate and present the summary statistics with the proper X and Y notation, as follows:



                 Car      Miles     Price
                           (X)       (Y)

                   1       9300      7100
                   2      10565     15500
                   3      15000      4400
                   4      15000      4400
                   5      17764      5900
                   6      57000      4600
                   7      65940      8800
                   8      73676      2000
                   9      77006      2750
                  10      93739      2550
                  11     146088       960
                  12     153260      1025




\begin{displaymath}\begin{array}{ll}
\overline{X}=61195 & \overline{Y}=4999\\
...
... \mbox{SD}_Y = 4079\\
\multicolumn{2}{c}{r=-.641}
\end{array}\end{displaymath}

Using the formulas for slope and intercept of the LS line, we get


\begin{displaymath}\begin{array}{ll}
b = -.641 \frac{4079}{50989} =-.05127\\
a= 4999- (-.05127) (61195) = 8136
\end{array}\end{displaymath}

so that the regression line is

\begin{displaymath}\mbox{PREDICTED}\;Y=a + b X = 8136 + (-.05127) X
\end{displaymath}

In terms of the original variable names, we may write the regression line as
PREDICTED PRICE = 8136 -.05127 (MILES)


next up previous contents index
Next: More on Simple Regression Up: Linear Regression Previous: Simple Linear Regression

2003-09-08