Make a table of values to determine the residuals.
Sum for y=x+2: 10 Sum for y=x+2.2: 10.16 Better Line of Fit: y=x+2
Practice makes perfect
We have been given the following table.
x
1
2
3
4
y
5
3
6
4
We have also been given two possible lines of fit.
Lines of Fit
y=x+2
y=x+2.2
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+2
Residual for y=x+2
y Predicted by y=x+2.2
Residual for y=x+2.2
1
5
y= 1+2= 3
5- 3= 2
y= 1+2.2= 3.2
5- 3.2= 1.8
2
3
y= 2+2= 4
3- 4= -1
y= 2+2.2= 4.2
3- 4.2= -1.2
3
6
y= 3+2= 5
6- 5= 1
y= 3+2.2= 5.2
6- 5.2= 0.8
4
4
y= 4+2= 6
4- 6= -2
y= 4+2.2= 6.2
4- 6.2= -2.2
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+2.