Here is some data where the individuals are 23 students in a statistics class, the independent variable is the studentsβ total score on their homeworks, while the dependent variable is their final total course points, both out of 100.
\begin{equation*}
\begin{matrix}
x:\amp 65\amp 65\amp 50\amp 53\amp 59\amp 92\amp 86\amp 84\amp 29\\
y:\amp 74\amp 71\amp 65\amp 60\amp 83\amp 90\amp 84\amp 88\amp 48\\
\ \\
x:\amp 29\amp 9\amp 64\amp 31\amp 69\amp 10\amp 57\amp 81\amp 81\\
y:\amp 54\amp 25\amp 79\amp 58\amp 81\amp 29\amp 81\amp 94\amp 86\\
\ \\
x:\amp 80\amp 70\amp 60\amp 62\amp 59\\
y:\amp 95\amp 68\amp 69\amp 83\amp 70\\
\end{matrix}
\end{equation*}
Here is the resulting scatterplot, made with
LibreOffice Calc (a free equivalent of
Microsoft Excel)
[Figure: scatter1.eps - placeholder for scatterplot]
It seems pretty clear that there is quite a strong linear association between these two variables, as is born out by the correlation coefficient,
\(r=.935\) (computed with
LibreOffice Calcβs
CORREL). Using then
STDEV.S and
AVERAGE, we find that the coefficients of the LSRL for this data,
\(\widehat{y}=mx+b\) are
\begin{equation*}
m=r\frac{s_y}{s_x}=.935\frac{18.701}{23.207}=.754\qquad{\rm and}\qquad b=\overline{y}-\overline{x}\,m=71-58\cdot .754=26.976
\end{equation*}
We can also use
LibreOffice Calcβs
Insert Trend Line, with
Show Equation, to get all this done automatically. Note that when
LibreOffice Calc writes the equation of the LSRL, it uses
\(f(x)\) in place of
\(\widehat{y}\text{,}\) as we would.
[Figure: scatter2.eps - placeholder for scatterplot with LSRL]