Sign In
| 8 Theory slides |
| 8 Exercises - Grade E - A |
| Each lesson is meant to take 1-2 classroom sessions |
Here are a few recommended readings before getting started with this lesson.
One way to assess how well a line of fit describes the data is to analyze residuals.
A residual is the vertical distance between a data point and the line of fit. When a line of fit has been drawn on a scatter plot, not all of the data points lie exactly on the line — some of them are above the line and some below. Therefore, each data point has one residual, which can be positive, negative, or zero.
A residual can also be defined as the observed y-value of a data point minus its predicted y-value, found using the line of fit.
The applet generates bivariate data and the equation of a line of fit for the data. Calculate the sum of the squares of the residuals for the given equation.
The table below shows the finishing times, in seconds, for the Olympic gold medalist in the men's 100-meter dash for the last six Olympic games. Olympic Game 1 represents the 2000 Olympic games and Olympic Game 6 represents the 2020 Olympic games.
Olympic Game | 1 | 2 | 3 | 4 | 5 | 6 |
---|---|---|---|---|---|---|
Finishing Time (sec) | 9.87 | 9.85 | 9.69 | 9.63 | 9.81 | 9.80 |
Sum of Squared Residuals for Equation II: 0.077
x | y (Actual) | y Predicted by y=-0.1x+10 | Residual for y=-0.1x+10 |
---|---|---|---|
1 | 9.87 | y=-0.1(1)+10=9.9 | 9.87−9.9=-0.03 |
2 | 9.85 | y=-0.1(2)+10=9.8 | 9.85−9.8=0.05 |
3 | 9.69 | y=-0.1(3)+10=9.7 | 9.69−9.7=-0.01 |
4 | 9.63 | y=-0.1(4)+10=9.6 | 9.63−9.6=0.03 |
5 | 9.81 | y=-0.1(5)+10=9.5 | 9.81−9.5=0.31 |
6 | 9.80 | y=-0.1(6)+10=9.4 | 9.80−9.4=0.40 |
Calculate power
Add terms
x | y (Actual) | y Predicted by y=-0.05x+10 | Residual for y=-0.05x+10 |
---|---|---|---|
1 | 9.87 | y=-0.05(1)+10=9.95 | 9.87−9.95=-0.08 |
2 | 9.85 | y=-0.05(2)+10=9.9 | 9.85−9.9=-0.05 |
3 | 9.69 | y=-0.05(3)+10=9.85 | 9.69−9.85=-0.16 |
4 | 9.63 | y=-0.05(1)+10=9.8 | 9.63−9.8=-0.17 |
5 | 9.81 | y=-0.05(5)+10=9.75 | 9.81−9.75=0.06 |
6 | 9.80 | y=-0.05(6)+10=9.70 | 9.80−9.70=0.10 |
Calculate power
Add terms
x | Residual for y=-0.1x+10 | Residual for y=-0.05x+10 |
---|---|---|
1 | -0.03 | -0.08 |
2 | 0.05 | -0.05 |
3 | -0.01 | -0.16 |
4 | 0.03 | -0.17 |
5 | 0.31 | 0.06 |
6 | 0.47 | 0.1 |
The points (x,residual) for each equation will be graphed on a scatter plot.
As can be seen, the residuals for Equation II are close the x-axis and therefore the sum of their squares has a lower value.
Maya is researching used cars similar to the one her older sister drives. She found some data showing the mileages x, in thousands of miles, and the selling prices y, in thousands dollars, of several used cars near her.
x | 23 | 12 | 18 | 30 | 6 | 26 |
---|---|---|---|---|---|---|
y | 15 | 15 | 17 | 12 | 19 | 15 |
Example Equation: y=-0.25x+20
Start by making a scatter plot for the given data set. Draw a line that passes through two data points and write its equation. Then, calculate the residuals for the equation.
Substitute (4,20) & (16,16)
Subtract term
ba=b/4a/4
Put minus sign in front of fraction
Distribute -31
LHS+20=RHS+20
a=33⋅a
Add fractions
x | y (Actual) | y Predicted by the equation | Residual |
---|---|---|---|
6 | 19 | y=-31(6)+364=358 | 19−358=-31 |
12 | 15 | y=-31(12)+364=352 | 15−352=-37 |
18 | 17 | y=-31(18)+364=346 | 17−346=35 |
23 | 15 | y=-31(23)+364=341 | 15−341=34 |
26 | 15 | y=-31(26)+364=338 | 15−358=37 |
30 | 12 | y=-31(30)+364=334 | 12−334=32 |
(-a)2=a2
(ba)m=bmam
Calculate power
Add fractions
Calculate quotient
x | y (Actual) | y Predicted by the equation | Residual |
---|---|---|---|
6 | 19 | y=-0.25(6)+20=18.5 | 19−18.5=0.5 |
12 | 15 | y=-0.25(12)+20=17 | 15−17=-2 |
18 | 17 | y=-0.25(18)+20=15.5 | 17−15.5=1.5 |
23 | 15 | y=-0.25(23)+20=14.25 | 15−14.25=0.75 |
26 | 15 | y=-0.25(26)+20=13.5 | 15−13.5=1.5 |
30 | 12 | y=-0.25(30)+20=12.5 | 12−12.5=-0.5 |
(-a)2=a2
Calculate power
Add terms
The applet generates bivariate data and two equations that model the data. To see the coordinates of a data point, move the cursor over it. Use the sum of squared residuals to determine the better fit for the data.
The table below shows the price of sweaters in dollars and the number of sweaters sold.
Price, x | 19 | 29 | 35 | 43 | 45 |
---|---|---|---|---|---|
Number Sold, y | 125 | 105 | 80 | 62 | 45 |
We are asked to find the sum of the square of the residuals of Equation I. Equation I: & y=- 2.7x+176 Let's first find the residuals. For a data point, its residual is the difference between the y-value of the data point and the y-value predicted by the line of fit.
x | y (Actual) | y Predicted by y=- 2.7x+176 | Residual |
---|---|---|---|
19 | 125 | - 2.7( 19)+176= 124.7 | 125- 124.7= 0.3 |
29 | 105 | - 2.7( 29)+176= 97.7 | 105- 97.7= 7.3 |
35 | 80 | - 2.7( 35)+176= 81.5 | 80- 81.5= - 1.5 |
43 | 62 | - 2.7( 43)+176= 59.9 | 62- 59.9= 2.1 |
45 | 45 | - 2.7( 45)+176= 54.5 | 45- 54.5= - 9.5 |
The values on the last column of the table will be squared and added.
The sum of squared residuals for Equation I, SSR_1, is 150.
In a similar fashion, we will find the residuals for Equation II.
x | y (Actual) | y Predicted by y=- 3.5x+201 | Residual |
---|---|---|---|
19 | 125 | - 3.5( 19)+201= 134.5 | 125- 134.5= - 9.5 |
29 | 105 | - 3.5( 29)+201= 99.5 | 105- 99.5= 5.5 |
35 | 80 | - 3.5( 35)+201= 78.5 | 80- 78.5= 1.5 |
43 | 62 | - 3.5( 43)+201= 50.5 | 62- 50.5= 11.5 |
45 | 45 | - 3.5( 45)+201= 43.5 | 45- 43.5= 1.5 |
Now that the residuals are found, they can be squared and added.
The sum of squared residuals for Equation II, SSR_2, is 257.
The smaller the sum of squared residuals, the better the line of fit. Since the Equation I has a lesser sum of squared residuals, it is the better line of fit.
SSR_1 & & SSR_2
150 & < & 257