Line of Fit Question

Kaitybug50

New member
Joined
Jan 16, 2020
Messages
3
We're covering a quick review of lines of fit for scatter plots and I'm lost.
Here's what the problem says:
1) What would the equation for a line of fit you would choose for the data below?
X57911
Y2589
 
… What would the equation for a line of fit you would choose …
Hi Kaitybug. To me, the phrases "a line of fit" and "you would choose" seem to imply an estimate. That is, you could plot the points using graph paper, and then draw a line (using a ruler) that passes as close to the four points as you're able to estimate. Then, carefully estimate the coordinates of two points on the line you drew, and calculate its slope, followed by writing the equation using whatever method you've learned.

Otherwise, you could use linear regression on a graphing calculator or other software, to get an equation. Statistic students might be expected to use a least-squares method, if the calculations are to be done by hand.

Do you think they want you to estimate the line of best fit, as I've guessed? There's a video on the steps I listed above, at Khan Academy.

?
 
Well, we aren't using graphing calculators or any fancy tools, so I'm guessing you could be right.
 
Okay, I did it the way you suggested. I got the equation of the line to be y=1.5x-5.5
Three of the points are on the line and the fourth isn't far off.
 
One way of doing this exactly is to form the matrix

[MATH]X = \begin{pmatrix}1 &5\\1&7\\1&9\\1&11\end{pmatrix},~ Y = \begin{pmatrix}2\\5\\8\\9\end{pmatrix}\\~\\ c = (X^TX)^{-1}X^TY\\ y = c_0 + c_1 x[/MATH]
This is called ordinary linear least squares.
 
Okay, I did it the way you suggested. I got the equation of the line to be y=1.5x-5.5
Three of the points are on the line and the fourth isn't far off.
Hi again. As an estimate, I think your equation is fine. I don't know what course you're taking or the intent of the exercise; perhaps, it's a lead into a more advanced discussion of the meaning of line-of-fit and specific method(s). Or, maybe it's just for hands-on fun, for a cursory discussion.

Here's some additional information, if you're interested. Using regression software, I obtained

y = 1.2x - 3.6

That software's goal was to reduce average error. Here's a diagram showing the scatterplot and the graph of the line, onto which I've drawn the error at each point (in red). In this context, 'error' means the vertical distance between the given point and the corresponding point on the line. (In other words, it's the difference between the true y-value and the line-of-fit's y-value.) When the actual point lies above the line of fit, the error is positive, and the error is negative when the actual point lies below the line.

linREG.JPG

If we average these four signed errors, we get 0. In other words, that's the best line of fit, if we want to minimize the average error between the data points and the line.

The line y = 1.5x - 5.5 yields an average error of 0.5 because there is no error for the first three points (they each lie directly on the line) and the vertical difference between the fourth point and the line is 2.

There are various mathematical methods for finding a line of best fit, given a set of data points. Different methods may generate different equations. In fact, one of those other methods could very well yield your equation, so, without knowing the real purpose of the exercise, I think you did a good job.

Cheers ?
 
We're covering a quick review of lines of fit for scatter plots and I'm lost.
Here's what the problem says:
1) What would the equation for a line of fit you would choose for the data below?
X57911
Y2589
Are you allowed to use MS-Excel?
 
Top