Paragraph

To compute the best-fit line and correlation coefficient by hand, it is often easiest to construct a table in a manner similar to how you might have computed the mean, variance, skewness and kurtosis in the previous chapter. Indeed,
Table 2.3.6. Computing best fit line and correlation coefficient by hand
\(x_k^2\) \(x_k\) \(y_k\) \(y_k^2\) \(x_k \cdot y_k\)
4 -2 3 9 -6
0 0 1 1 0
0 0 -1 1 0
1 1 1 1 1
9 3 1 1 3
9 3 -1 1 -3
16 4 0 0 0
39 9 4 14 7
Therefore
\begin{equation*} \overline{x} = \frac{9}{7} \end{equation*}
\begin{equation*} \overline{y} = \frac{4}{7} \end{equation*}
\begin{equation*} s_x^2 = \frac{7}{6} \cdot \left [ \frac{39}{7} - \left ( \frac{9}{7} \right )^2 \right ] = \frac{32}{7} \end{equation*}
\begin{equation*} s_y^2 = \frac{7}{6} \cdot \left [ \frac{14}{7} - \left ( \frac{4}{7} \right )^2 \right ] = \frac{41}{21} \end{equation*}
\begin{equation*} s_{xy} = \frac{7}{6} \cdot \left [ \frac{7}{7} - \frac{9}{7} \cdot \frac{4}{7} \right ] = \frac{13}{42} \end{equation*}
\begin{equation*} r = \frac{\frac{13}{42}}{\sqrt{\frac{32}{7}} \sqrt{\frac{41}{21}}} \end{equation*}
and the normal equations to find the actual line are
\begin{equation*} 39m + 9 b = 7 \text{ and } 9m + 7b = 4. \end{equation*}
You should go ahead and simplify these values, solve the system of equations, plot the points and draw the line to complete the creation and evaluation of this best-fit line.
in-context