Sign In
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
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.
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 |
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 |
Calculate power
Add terms
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.