Houghton Mifflin Harcourt Algebra 1, 2015
HM
Houghton Mifflin Harcourt Algebra 1, 2015 View details
2. Fitting a Linear Model to Data
Continue to next subchapter

Exercise 7 Page 366

Make a table of values to determine the residuals.

Sum for y=x+4: 7
Sum for y=x+4.2: 7.56
Better Line of Fit: y=x+4

Practice makes perfect

We are given the following table.

x 1 2 3 4
y 4 7 8 6

We are also given two possible lines of fit.

Lines of Fit
y=x+4 y=x+4.2

We are asked to determine which line of fit is better. To do that, let's first analyze the line of fit y=x+4.

y=x+4

We can calculate the predicted values for y=x+4.

x y (Actual) y Predicted by y=x+4
1 4 y= 1+4= 5
2 7 y= 2+4= 6
3 8 y= 3+4= 7
4 6 y= 4+4= 8

Now we can calculate the residuals which are the differences between the actual values and the predicted values.

x y (Actual) y Predicted by y=x+4 Residual for y=x+4
1 4 y= 1+4= 5 4- 5= -1
2 7 y= 2+4= 6 7- 6= 1
3 8 y= 3+4= 7 8- 7= 1
4 6 y= 4+4= 8 6- 8= -2
Now, we will square the residuals and find their sum s. This sum will represent how good the fit is. The lower the sum, the better fit. Let's do it!
s=( -1)^2+ 1^2+ 1^2+( -2)^2
s=1+1+1+4
s=7
We found that the sum for y=x+4 is s=7. Let's repeat this process for y=x+4.2.

y=x+4.2

Let's find the predicted values and the residuals for y=x+4.2.

x y (Actual) y Predicted by y=x+4.2 Residual for y=x+4.2
1 4 y= 1+4.2= 5.2 4- 5.2= -1.2
2 7 y= 2+4.2= 6.2 7- 6.2= 0.8
3 8 y= 3+4.2= 7.2 8- 7.2= 0.8
4 6 y= 4+4.2= 8.2 6- 8.2= -2.2
Now, we will square the residuals and find the sum s for the line y=x+4.2.
s=( -1.2)^2+( 0.8)^2+( 0.8)^2+( -2.2)^2
s=1.44+0.64+0.64+4.84
s=7.56
We found that the sum s for y=4.2 is equal to 7.56.

Comparison

We found that the sum of the squared residuals for y=x+4.2 is 7.56 and that the sum for y=x+4 is 7. As a result, we can say that y=x+4 is the better line of fit because it has lesser sum.