Make a table of values to determine the residuals.
Sum for y=x+1: 8 Sum for y=x+0.9: 7.33 Better Line of Fit: y=x+0.9
Practice makes perfect
We have been given the following table.
x
1
2
3
4
y
2
1
4
3
We have also been given two possible lines of fit.
Lines of Fit
y=x+1
y=x+0.9
In order to determine which line of fit is better, let's calculate the residuals for both lines.
x
y (Actual)
y Predicted by y=x+1
Residual for y=x+1
y Predicted by y=x+0.9
Residual for y=x+0.9
1
2
y= 1+1= 2
2- 2= 0
y= 1+0.9= 1.9
2- 1.9= 0.1
2
1
y= 2+1= 3
1- 3= -2
y= 2+0.9= 2.9
1- 2.9= -1.9
3
4
y= 3+1= 4
4- 4= 0
y= 3+0.9= 3.9
4- 3.9= 0.1
4
3
y= 4+1= 5
3- 5= -2
y= 4+0.9= 4.9
3- 4.9= -1.9
Now, we will square the residuals and find their sum s for each line so that we can compare which line is a better fit. Let's start with the line y=x+1.