Skip to main content

Section 1.7 Linear Regression

Subsection 1. Read a scatterplot

We read the coordinates of points on a scatterplot the same way we do for any other graph.

Subsubsection Example

Example 1.91.

The scatterplot shows the height and shoe size of a group of men.

  1. State the height and shoe size of the man represented by point \(A\text{.}\)
  2. Find the heights of two men with the same shoe size.
scatterplot
Solution
  1. The man represented by point \(A\) has shoe size \(11 \frac{1}{2}\) and is \(73 \frac{1}{2}\) inches tall.
  2. There are two men with shoe size 9, with heights 68 and 73 inches. There are also two men with shoe size \(9 \frac{1}{2}\text{,}\) with heights 68 and 71 inches.

Subsubsection Exercise

The scatterplot shows the heights of dance partners in a ballroom dance class.

  1. How tall is the shortest woman?
  2. What are the heights of the three partners of the 65-inch tall women?
scatterplot
Answer
  1. 59 in
  2. \(68 \frac{1}{2}\text{,}\) \(70\text{,}\) and \(71\) in

Subsection 2. Sketch a line of best fit

Of course, the points on a scatterplot may not lie on a straight line. But if they seem to cluster near a line, we can try to find that line.

Subsubsection Example

Example 1.93.

Sketch a line of best fit for the scatterplot in part 1.

Solution

We draw a line that lies as close as possible to all of the data points. As a rule of thumb, we try to keep equal numbers of points on each side of the line.

scatterplot

Subsubsection Exercise

Which of the lines fits the scatterplot best?

scatterplot
Answer
Line L

Subsection 3. Fit a line through two points

If we don't know the slope of a line, but we do know two points on the line, we can calculate the slope first and then use the point-slope formula.

Subsubsection Example

Example 1.95.

Find an equation for the line that passes through \((2,-1)\) and \((-1,3)\text{.}\)

Solution

We solve this problem in two steps: First, find the slope of the line, and then use the point-slope formula.

Step 1: Let \((x_1,y_1)=(2,-1)\) and \((x_2,y_2)=(-1,3)\text{.}\) Use the slope formula to find

\begin{align*} m \amp = \dfrac{y_2-y_1}{x_2-x_1}\\ \amp = \dfrac{3-(-1)}{-1-2} = \dfrac{4}{-3} = \dfrac{-4}{3} \end{align*}
line thru (2,-1) and (-1,3)

Step 2: Apply the point-slope formula with \(m=\dfrac{-4}{3}\) and \((x_1,y_1)=(2,-1)\text{.}\) (We can use either point in the formula.) Then

\begin{equation*} \dfrac{y-y_1}{x-x_1} = m~~~~~~~~\text{becomes}~~~~~~~~\dfrac{y-(-1)}{x-2} = \dfrac{-4}{3} \end{equation*}

Cross-multiply to find

\begin{align*} 3(y+1) \amp = -4(y-2) \amp \amp \blert{\text{Apply the distributive law.}}\\ 3y+3 \amp = -4x+8 \amp \amp \blert{\text{Solve for}~y.}\\ 3y \amp = -4x+5\\ y \amp = \dfrac{-4}{3}x + \dfrac{5}{3} \end{align*}

Subsubsection Exercise

Find an equation for the line that passes through \((-6,-1)\) and \((1,3)\text{.}\)

Answer

Step 1: Compute the slope.

Step 2: Use the point-slope formula.

\begin{equation*} y=\dfrac{4}{7}x+\dfrac{17}{7} \end{equation*}