Make a table of values to determine the residuals.
Sum for y=x+5: 114 Sum for y=x+5.3: 126.36 Better Line of Fit: y=x+5
Practice makes perfect
We have been given the following table.
x
1
2
3
4
y
4
1
3
2
We have also been given two possible lines of fit.
Lines of Fit
y=x+5
y=x+5.3
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+5
Residual for y=x+5
y Predicted by y=x+5.3
Residual for y=x+5.3
1
4
y= 1+5= 6
4- 6= -2
y= 1+5.3= 6.3
4- 6.3= -2.3
2
1
y= 2+5= 7
1- 7= -6
y= 2+5.3= 7.3
1- 7.3= -6.3
3
3
y= 3+5= 8
3- 8= -5
y= 3+5.3= 8.3
3- 8.3= -5.3
4
2
y= 4+5= 9
2- 9= -7
y= 4+5.3= 9.3
2- 9.3= -7.3
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+5.