2. Fitting a Linear Model to Data
Sign In
Make a table of values to determine the residuals.
Sum for y=1.6x+4: 41.64
Sum for y=1.8x+4: 63.96
Better Line of Fit: y=1.6x+4
We have been given the following table.
| x | 1 | 3 | 5 | 7 |
|---|---|---|---|---|
| y | 2 | 6 | 8 | 13 |
| Lines of Fit | |
|---|---|
| y=1.6x+4 | y=1.8x+4 |
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=1.6x+4 | Residual for y=1.6x+4 | y Predicted by y=1.8x+4 | Residual for y=1.8x+4 |
|---|---|---|---|---|---|
| 1 | 2 | y=1.6( 1)+4= 5.6 | 2- 5.6= -3.6 | y=1.8( 1)+4= 5.8 | 2- 5.8= -3.8 |
| 3 | 6 | y=1.6( 3)+4= 8.8 | 6- 8.8= -2.8 | y=1.8( 3)+4= 9.4 | 6- 9.4= -3.4 |
| 5 | 8 | y=1.6( 5)+4= 12 | 8- 12= -4 | y=1.8( 5)+4= 13 | 8- 13= -5 |
| 7 | 13 | y=1.6( 7)+4= 15.2 | 13- 15.2= -2.2 | y=1.8( 7)+4= 16.6 | 13- 16.6= -3.6 |