Learning Outcomes
- Identify outliers numerically by comparing residuals to two standard errors
How does the outlier affect the best-fit line?
Numerically and graphically, we have identified the point (65, 175) as an outlier. We should re-examine the data for this point to see if there are any problems with the data. If there is an error, we should fix the error if possible, or delete the data. If the data is correct, we would leave it in the data set. For this problem, we will suppose that we examined the data and found that this outlier data was an error. Therefore, we will continue on and delete the outlier so that we can explore how it affects the results as a learning experience.
Compute a new best-fit line and correlation coefficient using the ten remaining points:
On the TI-83, TI-83+, and TI-84+ calculators, delete the outlier from L1 and L2. Using the LinRegTTest, the new line of best fit and the correlation coefficient is:
[latex]\hat{y}[/latex] = –355.19 + 7.39x and r = 0.9121
The new line with r = 0.9121 is a stronger correlation than the original (r = 0.6631) because r = 0.9121 is closer to one. This means that the new line is a better fit for the ten remaining data values. The line can better predict the final exam score given the third exam score.
Numerical identification of outliers: Calculating s and finding outliers manually
If you do not have the function LinRegTTest, then you can calculate the outlier in the first example by doing the following.
First, square each |y – ŷ |
The squares are 352; 172; 162; 62; 192; 92; 32; 12; 102; 92; 12
Then, add (sum) all the |y – ŷ | squared terms using the formula
[latex]{\sum_{i=1}^{11}}{\left ( |{y_i} - {\hat y_i}| \right )^2}[/latex] = [latex]{\sum_{i=1}^{11}}{\epsilon_i}^2[/latex] (Recall that [latex]{y_i} - {\hat y_i}[/latex] = [latex]{\epsilon_i}[/latex].
= 352 + 172 + 162 + 62 + 192 + 92 + 32 + 12 + 102 + 92 + 12
= 2440 = SSE. The result, SSE is the Sum of Squared Errors.
Next, calculate s, the standard deviation of all the y – ŷ = ε values where n = the total number of data points.
The calculation is [latex]s = {\sqrt{\dfrac{SSE}{n - 2}}}[/latex].
For the third exam/final exam problem, [latex]s = {\sqrt{\frac{2440}{11 - 2}}} = 16.47[/latex].
Next, multiply s by 2:
(2)(16.47) = 32.94
32.94 is 2 standard deviations away from the mean of the y – [latex]\hat {y}[/latex] values.
If we were to measure the vertical distance from any data point to the corresponding point on the line of best fit and that distance is at least 2s, then we would consider the data point to be “too far” from the line of best fit. We call that point a potential outlier.
For the example, if any of the |y – [latex]\hat {y}[/latex]| values are at least 32.94, the corresponding (x, y) data point is a potential outlier.
For the third exam/final exam problem, all the |y – [latex]\hat {y}[/latex]|’s are less than 31.29 except for the first one which is 35.
35 > 31.29 That is, |y – [latex]\hat {y}[/latex]| ≥ (2)(s)
The point which corresponds to |y – [latex]\hat {y}[/latex]| = 35 is (65, 175). Therefore, the data point (65,175) is a potential outlier. For this example, we will delete it. (Remember, we do not always delete an outlier).
Note
When outliers are deleted, the researcher should either record that data was deleted, and why, or the researcher should provide results both with and without the deleted data. If data is erroneous and the correct values are known (e.g., student one actually scored a 70 instead of a 65), then this correction can be made to the data.
The next step is to compute a new best-fit line using the ten remaining points. The new line of best fit and the correlation coefficient is:
[latex]\hat{y}[/latex] = –355.19 + 7.39x and r = 0.9121
Example 2
Using this new line of best fit (based on the remaining ten data points in the third exam/final exam example (example 2)), what would a student who receives a 73 on the third exam expect to receive on the final exam? Is this the same as the prediction made using the original line?
try it 2
The data points for the graph from the third exam/final exam example (example 2 on the page linked) are as follows: (1, 5), (2, 7), (2, 6), (3, 9), (4, 12), (4, 13), (5, 18), (6, 19), (7, 12), and (7, 21). Remove the outlier and recalculate the line of best fit. Find the value of [latex]\hat{y}[/latex] when x = 10.
Example 3
The Consumer Price Index (CPI) measures the average change over time in the prices paid by urban consumers for consumer goods and services. The CPI affects nearly all Americans because of the many ways it is used. One of its biggest uses is as a measure of inflation. By providing information about price changes in the Nation’s economy to government, business, and labor, the CPI helps them to make economic decisions. The President, Congress, and the Federal Reserve Board use the CPI’s trends to formulate monetary and fiscal policies. In the following table, x is the year and y is the CPI.
x | y | x | y |
---|---|---|---|
1915 | 10.1 | 1969 | 36.7 |
1926 | 17.7 | 1975 | 49.3 |
1935 | 13.7 | 1979 | 72.6 |
1940 | 14.7 | 1980 | 82.4 |
1947 | 24.1 | 1986 | 109.6 |
1952 | 26.5 | 1991 | 130.7 |
1964 | 31.0 | 1999 | 166.6 |
- Draw a scatterplot of the data.
- Calculate the least-squares line. Write the equation in the form ŷ = a + bx.
- Draw the line on the scatterplot.
- Find the correlation coefficient. Is it significant?
- What is the average CPI for the year 1990?
Note
In the example, notice the pattern of the points compared to the line. Although the correlation coefficient is significant, the pattern in the scatterplot indicates that a curve would be a more appropriate model to use than a line. In this example, a statistician should prefer to use other methods to fit a curve to this data, rather than model the data with the line we found. In addition to doing the calculations, it is always important to look at the scatterplot when deciding whether a linear model is appropriate.
If you are interested in seeing more years of data, visit the Bureau of Labor Statistics CPI website ftp://ftp.bls.gov/pub/special.requests/cpi/cpiai.txt; our data is taken from the column entitled “Annual Avg.” (third column from the right). For example you could add more current years of data. Try adding the more recent years: 2004: CPI = 188.9; 2008: CPI = 215.3; 2011: CPI = 224.9. See how it affects the model. (Check: [latex]\hat{y}[/latex] = –4436 + 2.295x; r = 0.9018. Is r significant? Is the fit better with the addition of the new points?)
try it 3
The following table shows economic development measured in per capita income PCINC.
Year | PCINC | Year | PCINC |
---|---|---|---|
1870 | 340 | 1920 | 1050 |
1880 | 499 | 1930 | 1170 |
1890 | 592 | 1940 | 1364 |
1900 | 757 | 1950 | 1836 |
1910 | 927 | 1960 | 2132 |
- What are the independent and dependent variables?
- Draw a scatter plot.
- Use regression to find the line of best fit and the correlation coefficient.
- Interpret the significance of the correlation coefficient.
- Is there a linear relationship between the variables?
- Find the coefficient of determination and interpret it.
- What is the slope of the regression equation? What does it mean?
- Use the line of best fit to estimate PCINC for 1900, for 2000.
- Determine if there are any outliers.
95% critical values of the sample correlation coefficient table
Degrees of Freedom: n – 2 | Critical Values: (+ and –) |
---|---|
1 | 0.997 |
2 | 0.950 |
3 | 0.878 |
4 | 0.811 |
5 | 0.754 |
6 | 0.707 |
7 | 0.666 |
8 | 0.632 |
9 | 0.602 |
10 | 0.576 |
11 | 0.555 |
12 | 0.532 |
13 | 0.514 |
14 | 0.497 |
15 | 0.482 |
16 | 0.468 |
17 | 0.456 |
18 | 0.444 |
19 | 0.433 |
20 | 0.423 |
21 | 0.413 |
22 | 0.404 |
23 | 0.396 |
24 | 0.388 |
25 | 0.381 |
26 | 0.374 |
27 | 0.367 |
28 | 0.361 |
29 | 0.355 |
30 | 0.349 |
40 | 0.304 |
50 | 0.273 |
60 | 0.250 |
70 | 0.232 |
80 | 0.217 |
90 | 0.205 |
100 | 0.195 |