Make a table of values to determine the residuals.
Sum for y=2x+1: 40 Sum for y=2x+1.1: 41.64 Better Line of Fit: y=2x+1
Practice makes perfect
We have been given the following table.
x
1
2
3
4
y
1
7
3
5
We have also been given two possible lines of fit.
Lines of Fit
y=2x+1
y=2x+1.1
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=2x+1
Residual for y=2x+1
y Predicted by y=2x+1.1
Residual for y=2x+1.1
1
1
y=2( 1)+1= 3
1- 3= -2
y=2( 1)+1.1= 3.1
1- 3.1= -2.1
2
7
y=2( 2)+1= 5
7- 5= 2
y=2( 2)+1.1= 5.1
7- 5.1= 1.9
3
3
y=2( 3)+1= 7
3- 7= -4
y=2( 3)+1.1= 7.1
3- 7.1= -4.1
4
5
y=2( 4)+1= 9
5- 9= -4
y=2( 4)+1.1= 9.1
5- 9.1= -4.1
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=2x+1.